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

Backups V2 Follow-up Fixes / Improvements #6213

Merged
merged 53 commits into from
Dec 20, 2024
Merged

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Oct 18, 2024

Fixes APP-1297
Fixes APP-1050
Fixes APP-2002
Fixes APP-1649
Fixes APP-2120

What changed (plus any additional context for devs)

This PR introduces a lot of stability changes to backups. I'll layout the important changes here.

  • Removes the dependency on UserData.json since it quickly becomes muddy dealing with backup data and user data.
  • Instead of adding to a backup file, we create a new backup file every time now to prevent potentially corrupting a backup file.
  • Fixes the missing app portal when restoring / creating a wallet (or group)
  • Fixes the portal which used to wrap the entire app and instead use a Zustand store to control whether or not it's shown
  • Instead of relying on local wallet state to determine whether or not they have enabled the cloud backups, we now determine that based on if they have at least one backup.
  • Adds backupsStore Zustand store which controls the synced backup data
  • Prevents any backup actions (create/restore) if the local state isn't in sync with remote data
  • Fixes bug with local password being saved as empty string
  • Fixes bug where restoring to backup wouldn't navigate back to wallet screen
  • Fixes bug where incorrect password indicator wasn't shown on restore screen
  • Fixes issue where notifications + app icon unlock sheets would be stacked on new wallets
  • Fixes native crash with syncing cloud-fs in-flight multiple times

Screen recordings / screenshots

What to test

https://www.notion.so/rainbowdotme/Backups-V2-Fixes-QA-Hand-off-149b001b85b4800fbf72c0f347b992b0?showMoveTo=true&saveParent=true

Copy link

linear bot commented Oct 18, 2024

@walmat walmat changed the title Fix missing backup password when saving Backups V2 Follow-up Fixes / Improvements Nov 8, 2024
.vscode/settings.json Outdated Show resolved Hide resolved
src/App.tsx Outdated Show resolved Hide resolved
</Portal>
<Portal />
<PortalConsumer />
<BackupsSync />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In charge of initial backup store sync on mount

Comment on lines +92 to +105
const AppWithRedux = connect<AppProps, AppDispatch, AppProps, AppState>(
state => ({
walletReady: state.appState.walletReady,
}),
null,
null,
{
areStatesEqual: (next, prev) => {
// Only update if walletReady actually changed
return next.appState.walletReady === prev.appState.walletReady;
},
areOwnPropsEqual: shallowEqual,
}
)(memo(App));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only really want to re-render the App when walletReady has changed.. this fixes that

Comment on lines +130 to +132
if (!backupProvider) {
backupsStore.getState().setBackupProvider(WalletBackupTypes.manual);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coming from undefined -> manual if not already set to cloud

@brunobar79
Copy link
Member

Launch in simulator or device for 9cace3b

@walmat walmat added the blocked Blocked by anything (design, UI work, other task, etc) label Dec 5, 2024
@walmat
Copy link
Contributor Author

walmat commented Dec 5, 2024

Blocked by #6276 due to multiple AbsolutePortal components being mounted. Merge greg's PR in first so I can rebase and refactor this to use that.

@brunobar79
Copy link
Member

Launch in simulator or device for 049e61e

Copy link
Member

@BrodyHughes BrodyHughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunobar79
Copy link
Member

Launch in simulator or device for ee6e027

@brunobar79 brunobar79 added the release for release blockers and release candidate branches label Dec 19, 2024
@walmat walmat removed the blocked Blocked by anything (design, UI work, other task, etc) label Dec 19, 2024
@brunobar79
Copy link
Member

Launch in simulator or device for ed377cc

Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crispy stuff

referenced the notion doc to run through some flows, did not encounter any issues

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Only concern is the pwd

src/components/backup/RestoreCloudStep.tsx Show resolved Hide resolved
src/components/backup/RestoreCloudStep.tsx Show resolved Hide resolved
src/components/backup/RestoreCloudStep.tsx Outdated Show resolved Hide resolved
@@ -135,6 +135,7 @@ export function useConsolidatedTransactions(
keepPreviousData: true,
getNextPageParam: lastPage => lastPage?.nextPage,
refetchInterval: CONSOLIDATED_TRANSACTIONS_INTERVAL,
enabled: !!address,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aura +1000

@brunobar79
Copy link
Member

Launch in simulator or device for 7d608da

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

@brunobar79
Copy link
Member

Launch in simulator or device for 45ba0aa

Comment on lines +31 to +33
const { status } = backupsStore(state => ({
status: state.status,
}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { status } = backupsStore(state => ({
status: state.status,
}));
const status = backupsStore(state => state.status);

Comment on lines +56 to +60
const { status, backups, mostRecentBackup } = backupsStore(state => ({
status: state.status,
backups: state.backups,
mostRecentBackup: state.mostRecentBackup,
}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { status, backups, mostRecentBackup } = backupsStore(state => ({
status: state.status,
backups: state.backups,
mostRecentBackup: state.mostRecentBackup,
}));
const { status, backups, mostRecentBackup } = backupsStore()

setIncorrectPassword(false);
}, []);

const onSubmit = useCallback(async () => {
setLoading(true);
// NOTE: Localizing password to prevent an empty string from being saved if we re-render
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localizing?

@brunobar79 brunobar79 merged commit 572edec into develop Dec 20, 2024
10 of 11 checks passed
@brunobar79 brunobar79 deleted the @matthew/APP-1297 branch December 20, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release for release blockers and release candidate branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants