Skip to content

Commit

Permalink
[native] fix creating new device list in reorderAndSignDeviceList
Browse files Browse the repository at this point in the history
Summary:
Fix for [ENG-10102](https://linear.app/comm/issue/ENG-10102/non-primary-device-create-invalid-device-list-update-when-migrating).

Depends on D14216

Test Plan: Tested that when running device list o non-primary new device list is properly created

Reviewers: bartek, tomek

Reviewed By: bartek, tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D14217
  • Loading branch information
xsanm committed Jan 20, 2025
1 parent 8c3bf7e commit 0333f39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion native/backup/use-migration-to-new-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ async function reorderAndSignDeviceList(
const newDevices =
thisDeviceIndex === 0
? currentDevices
: [thisDeviceID, ...currentDevices.splice(thisDeviceIndex, 1)];
: [
thisDeviceID,
...currentDevices.filter(deviceID => deviceID !== thisDeviceID),
];

const rawList = composeRawDeviceList(newDevices);
const signedList = await signDeviceListUpdate(rawList);
Expand Down

0 comments on commit 0333f39

Please sign in to comment.