Skip to content

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Oct 2, 2025

Description

applied 15 commits related to local backup:

  • Core backup functionality (commits 1-8)
  • Critical fixes and improvements (commits 9-12)
  • Optional messages backup feature (commits 13-15)

Commits:

  1. Main implementation (af22c26)
  2. Backup/restore tests (3d44534)
  3. Enable feature flag (c0100c2)
  4. Fix missing image in group events (f0fa5ca)
  5. Ignore already backed up watch accounts (a184be6)
  6. Process all backups before throwing error (be02ece)
  7. Fix localUrl for images (7586c41)
  8. Remove Waku backup (709900f)
  9. Use profile keypair for backup files (5a1d8ef)
  10. Set backup path to config folder (daffcd4)
  11. Use compressed pubkey for backup name (197dfc3)
  12. Fix backup import for left communities (33f84c7)
  13. Messages backup POC (1d3fdc7)
  14. Fix messages backup setting name (16d965e)
  15. Send signal to reset chat cursors (cd0f04d)

jrainville and others added 15 commits October 2, 2025 12:43
Fixes status-im/status-desktop#18248 status-im/status-desktop#18107 status-im/status-desktop#18120 status-im/status-desktop#18122 status-im/status-desktop#18141 status-im/status-desktop#18121

Implements all the backend for the local user data backups.

Uses the scaffold @osmaczko created to make it more extendable. Instead of using the old Messenger code for backups, we now use a new controller that let's other modules register to be backed up. This includes the messenger for chats, contacts and communities, the accounts service for settings and the wallet service for watch-only accounts.

I also created new Protobufs for those backups, so that we no longer user the super generic Waku Backup protobuf.

Finally, I added some integration tests and a functional test that does the whole flow.

A lot of cleanups can still be done to reduce duplication, but they can be done in another commit/issue, since the internal of the services can be modified without the backup process being affected, since the protobufs are in place already.
* test_: add restore account

* test_: add restore account tests

* test_: add restore account tests

* test_: add concurrent test

* test_: class rename

* test_: fix assert

* test_: review comments

* test_: fix

* test_: fix review comments
Fixes status-im/status-desktop#18731

Turns out our pubkeys all start with the same prefix, and I chose exactly the length of the prefix in the previous version, so all files had the same name.
Using the profile keypair solves this
This should make it work on mobile as well plus it sets a default to the setting
It is the name that users are used to see, so it will be less confusing
This is a fix for the backup and also just a performance improvement. Basically, when we have a SyncCommunity message, we leave the community if the state of said community is not pending or joined (meaning we left it). However, in the case of backup messages, we backup left communities too, but when trying to "leave" those communities, it threw an error about unknown chat, since we never spectated that community in that imported profile.

The solution is just to early return when we don't have anything to leave. We gracefully ignore the error in the Sync function and pass the error when actively trying to leave (you can't leave twice).

Added tests and also cleaned up some warnings.
Fixes status-im/status-desktop#18529

Implements a rough but functional proof of concept for message backup and import.

It is guarded by a new setting so that you need to opt-in to have it, thus not breaking PFS by default.

It works for text messages, contacts requests, images, emojis, transaction commands, pins and stickers.
@vkjr vkjr self-assigned this Oct 2, 2025
Copy link

github-actions bot commented Oct 2, 2025

We require commits to follow the Conventional Commits, but with _ for non-breaking changes.
Please fix these commit messages:

feat(backup): send a signal to reset chat cursors on message imports
fix(settings): fix wrongly named reactFieldName for messages backup
feat(backup): implement messages backup poc
fix(backup): backup import fails if the community was left
feat(backup): set backup path to user's config folder if not set
fix(backup): use profile keypair for backup files
chore(backup): remove waku backup and keep only local backup

@vkjr vkjr changed the title Cherrypicking commits related to local backup to old release branch (for 2.34 mobile) feat: local backup cherrypicked to old release branch (for 2.34 mobile) Oct 2, 2025
@status-im-auto
Copy link
Member

status-im-auto commented Oct 2, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
cd0f04d #1 2025-10-02 12:16:08 ~2 min macos 📄log
cd0f04d #1 2025-10-02 12:16:15 ~2 min windows 📄log
cd0f04d #1 2025-10-02 12:41:19 ~27 min linux 📄log
✖️ cd0f04d #1 2025-10-02 12:52:47 ~38 min tests-rpc 📄log
✖️ cd0f04d #1 2025-10-02 12:54:18 ~40 min tests 📄log

@vkjr
Copy link
Contributor Author

vkjr commented Oct 5, 2025

Closing because there is an existing one

@vkjr vkjr closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants