Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Hotfix 2024-07-02 #7241

Merged
merged 13 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @ledgerhq/live-cli

## 24.3.2

### Patch Changes

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 24.3.2-hotfix.0

### Patch Changes

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 24.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ledgerhq/live-cli",
"version": "24.3.1",
"version": "24.3.2",
"description": "ledger-live CLI version",
"repository": {
"type": "git",
Expand Down
14 changes: 14 additions & 0 deletions apps/ledger-live-desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# ledger-live-desktop

## 2.82.2

### Patch Changes

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 2.82.2-hotfix.0

### Patch Changes

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 2.82.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"private": true,
"main": "./.webpack/main.bundle.js",
"version": "2.82.1",
"version": "2.82.2",
"scripts": {
"start:prod": "electron ./.webpack/main.bundle.js",
"start": "cross-env NODE_ENV=development node ./tools/main.js",
Expand Down
42 changes: 42 additions & 0 deletions apps/ledger-live-mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# live-mobile

## 3.45.2

### Patch Changes

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`fc95e03`](https://github.com/LedgerHQ/ledger-live/commit/fc95e032a0045093e343017051fc2f64fa3bcdef) Thanks [@valpinkman](https://github.com/valpinkman)! - Bluetooth update banner to always display but shows the correct message in a drawer if the update is not supported

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`22a4ebf`](https://github.com/LedgerHQ/ledger-live/commit/22a4ebf8130b0c8f06c132769a6b0ef5602bfd7d) Thanks [@valpinkman](https://github.com/valpinkman)! - move update firmware checks to the ViewProps component and add tests

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`a9954fa`](https://github.com/LedgerHQ/ledger-live/commit/a9954fac8d0827d659f1e0f134d437bd45802cbf) Thanks [@valpinkman](https://github.com/valpinkman)! - Add new tests for the UpdateBanner

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`aa30245`](https://github.com/LedgerHQ/ledger-live/commit/aa302450112c7215263a266fb1bb07256d9efdeb) Thanks [@valpinkman](https://github.com/valpinkman)! - Add version check for nano X bluetooth firmware update

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 3.45.2-hotfix.3

### Patch Changes

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`fc95e03`](https://github.com/LedgerHQ/ledger-live/commit/fc95e032a0045093e343017051fc2f64fa3bcdef) Thanks [@valpinkman](https://github.com/valpinkman)! - Bluetooth update banner to always display but shows the correct message in a drawer if the update is not supported

## 3.45.2-hotfix.2

### Patch Changes

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`a9954fa`](https://github.com/LedgerHQ/ledger-live/commit/a9954fac8d0827d659f1e0f134d437bd45802cbf) Thanks [@valpinkman](https://github.com/valpinkman)! - Add new tests for the UpdateBanner

- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]:
- @ledgerhq/[email protected]

## 3.45.2-hotfix.1

### Patch Changes

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`22a4ebf`](https://github.com/LedgerHQ/ledger-live/commit/22a4ebf8130b0c8f06c132769a6b0ef5602bfd7d) Thanks [@valpinkman](https://github.com/valpinkman)! - move update firmware checks to the ViewProps component and add tests

## 3.45.2-hotfix.0

### Patch Changes

- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`aa30245`](https://github.com/LedgerHQ/ledger-live/commit/aa302450112c7215263a266fb1bb07256d9efdeb) Thanks [@valpinkman](https://github.com/valpinkman)! - Add version check for nano X bluetooth firmware update

## 3.45.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "live-mobile",
"version": "3.45.1",
"version": "3.45.2",
"private": true,
"scripts": {
"postinstall": "zx ./scripts/post.mjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,46 @@ const EUROPA_DATA = {
productName: getDeviceModel(DeviceModelId.europa).productName,
};

const OUTDATED_NANOX_BLE_UPDATE = {
deviceModelId: DeviceModelId.nanoX,
productName: getDeviceModel(DeviceModelId.nanoX).productName,
version: "2.3.0",
fwVersion: "2.4.0",
hasCompletedOnboarding: true,
wired: false,
hasConnectedDevice: true,
};

const oldUpdateFlowNotSupportedDataSet: Array<{
deviceModelId: DeviceModelId;
version: string;
fwVersion: string;
productName: string;
}> = [
{ ...NANO_S_DATA, version: "1.6.0" },
{ ...NANO_X_DATA, version: "1.2.9" },
{ ...NANO_SP_DATA, version: "0.9.9" },
{ ...NANO_S_DATA, version: "1.6.0", fwVersion: "1.7.0" },
{ ...NANO_X_DATA, version: "1.2.9", fwVersion: "1.3.0" },
{ ...NANO_SP_DATA, version: "0.9.9", fwVersion: "1.0.0" },
];

const oldUpdateFlowSupportedDataSet: Array<{
deviceModelId: DeviceModelId;
version: string;
fwVersion: string;
productName: string;
}> = [
{ ...NANO_S_DATA, version: "1.6.1" },
{ ...NANO_SP_DATA, version: "1.0.0" },
{ ...NANO_S_DATA, version: "1.6.1", fwVersion: "1.7.2" },
{ ...NANO_SP_DATA, version: "1.0.0", fwVersion: "1.1.0" },
];

const newUpdateFlowSupportedDataSet: Array<{
deviceModelId: DeviceModelId;
version: string;
fwVersion: string;
productName: string;
}> = [
{ ...STAX_DATA, version: "1.0.0" },
{ ...EUROPA_DATA, version: "1.0.0" },
{ ...NANO_X_DATA, version: "1.3.0" },
{ ...STAX_DATA, version: "1.0.0", fwVersion: "1.1.0" },
{ ...EUROPA_DATA, version: "1.0.0", fwVersion: "1.1.0" },
{ ...NANO_X_DATA, version: "2.4.0", fwVersion: "2.4.1" },
];

describe("<UpdateBanner />", () => {
Expand Down Expand Up @@ -115,6 +128,7 @@ describe("<UpdateBanner />", () => {
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: "3.0.0",
},
});

Expand All @@ -139,6 +153,7 @@ describe("<UpdateBanner />", () => {
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: "3.0.0",
},
});

Expand All @@ -164,6 +179,7 @@ describe("<UpdateBanner />", () => {
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: "3.0.0",
},
});

Expand Down Expand Up @@ -201,11 +217,88 @@ describe("<UpdateBanner />", () => {
expect(navigateToNewUpdateFlow).not.toHaveBeenCalled();
});

it("should open the unsupported drawer if there is a bluetooth update on Android on Nano X with version < 2.4.0", async () => {
const { fwVersion, ...nanoX } = OUTDATED_NANOX_BLE_UPDATE;
PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: fwVersion,
},
});

const { user } = render(<UpdateBanner onBackFromUpdate={() => {}} />, {
overrideInitialState: makeOverrideInitialState({
...nanoX,
}),
});

// Check that the banner is displayed with the correct wording
expect(await screen.findByText("OS update available")).toBeOnTheScreen();
expect(
await screen.findByText("Tap to update your Ledger Nano X to OS version mockVersion."),
).toBeOnTheScreen();

// Press the banner
await user.press(screen.getByTestId("fw-update-banner"));

// Check that the unsupported drawer is displayed
expect(await screen.findByText("USB cable needed")).toBeOnTheScreen();
expect(
await screen.findByText(
"To start the firmware update, plug your Ledger Nano X to your mobile phone using a USB cable.",
),
).toBeOnTheScreen();

// Check that the entrypoints to the update flows are not called
expect(navigateToOldUpdateFlow).not.toHaveBeenCalled();
expect(navigateToNewUpdateFlow).not.toHaveBeenCalled();
});

it("should open the unsupported drawer if there is a bluetooth update on iOS on Nano X with version < 2.4.0", async () => {
const { fwVersion, ...nanoX } = OUTDATED_NANOX_BLE_UPDATE;
PlatformSpy.mockReturnValue({ OS: "ios" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: fwVersion,
},
});

const { user } = render(<UpdateBanner onBackFromUpdate={() => {}} />, {
overrideInitialState: makeOverrideInitialState({
...nanoX,
}),
});

// Check that the banner is displayed with the correct wording
expect(await screen.findByText("OS update available")).toBeOnTheScreen();
expect(
await screen.findByText("Tap to update your Ledger Nano X to OS version mockVersion."),
).toBeOnTheScreen();

// Press the banner
await user.press(screen.getByTestId("fw-update-banner"));

// Check that the unsupported drawer is displayed
expect(await screen.findByText("Firmware Update")).toBeOnTheScreen();
expect(
await screen.findByText(
"Update your Ledger Nano firmware by connecting it to the Ledger Live application on desktop",
),
).toBeOnTheScreen();

// Check that the entrypoints to the update flows are not called
expect(navigateToOldUpdateFlow).not.toHaveBeenCalled();
expect(navigateToNewUpdateFlow).not.toHaveBeenCalled();
});

it("should open the unsupported drawer if there is an update and it's Android but the device has to be wired", async () => {
PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: "3.0.0",
},
});

Expand Down Expand Up @@ -242,12 +335,13 @@ describe("<UpdateBanner />", () => {
expect(navigateToNewUpdateFlow).not.toHaveBeenCalled();
});

oldUpdateFlowNotSupportedDataSet.forEach(({ deviceModelId, version, productName }) => {
oldUpdateFlowNotSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => {
it(`should open the unsupported drawer if there is an update and it's Android but the update is not supported for this device version (${version} ${deviceModelId})`, async () => {
PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: fwVersion,
},
});

Expand Down Expand Up @@ -284,12 +378,13 @@ describe("<UpdateBanner />", () => {
});
});

oldUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName }) => {
oldUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => {
it(`should redirect to the OLD firmware update flow if the device is supported (${version} ${deviceModelId})`, async () => {
PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: fwVersion,
},
});

Expand All @@ -316,12 +411,13 @@ describe("<UpdateBanner />", () => {
});
});

newUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName }) => {
newUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => {
it(`should redirect to the NEW firmware update flow if the device is supported (${version} ${deviceModelId})`, async () => {
PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform);
useLatestFirmware.mockReturnValue({
final: {
name: "mockVersion",
version: fwVersion,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const UpdateBanner = ({
: undefined;

const deviceName = lastConnectedDevice?.deviceName;

return bannerVisible ? (
<>
<Pressable onPress={onClickUpdate} testID="fw-update-banner">
Expand Down
Loading
Loading