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

fix_: send accounts event on handling backed up accounts #5739

Merged

Conversation

smohamedjavid
Copy link
Member

Needed for status-im/status-mobile#18613

Summary

Issue:

The collectables are not fetched whenever a profile is recovered with multiple wallet accounts.

Root cause:

We don't send any accounts event whenever we handle the accounts from backed-up data. This makes watchers fail to react to it.

Changes / fixes:

This PR moves the accountsFeed from initServices to the status node config, and adds a reference to messenger config for sending events on handling backed-up data.

@smohamedjavid smohamedjavid self-assigned this Aug 19, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Aug 19, 2024

Jenkins Builds

Click to see older builds (46)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f4d5716 #1 2024-08-19 09:43:13 ~2 min tests-rpc 📄log
✖️ f4d5716 #1 2024-08-19 09:43:22 ~2 min tests 📄log
✔️ f4d5716 #1 2024-08-19 09:44:45 ~4 min linux 📦zip
✔️ f4d5716 #1 2024-08-19 09:45:25 ~4 min ios 📦zip
✔️ f4d5716 #1 2024-08-19 09:46:06 ~5 min android 📦aar
✖️ abdb2b6 #2 2024-08-19 09:55:14 ~1 min tests 📄log
✔️ abdb2b6 #2 2024-08-19 09:55:31 ~1 min android 📦aar
✔️ abdb2b6 #2 2024-08-19 09:56:25 ~2 min tests-rpc 📄log
✔️ abdb2b6 #2 2024-08-19 09:57:51 ~3 min linux 📦zip
✔️ abdb2b6 #2 2024-08-19 09:58:37 ~4 min ios 📦zip
✔️ 60b5499 #3 2024-08-19 11:00:13 ~2 min android 📦aar
✔️ 60b5499 #3 2024-08-19 11:00:21 ~2 min linux 📦zip
✔️ 60b5499 #3 2024-08-19 11:00:28 ~2 min tests-rpc 📄log
✔️ 60b5499 #3 2024-08-19 11:06:49 ~8 min ios 📦zip
✖️ 60b5499 #3 2024-08-19 11:34:54 ~36 min tests 📄log
✖️ 60b5499 #5 2024-08-19 12:16:00 ~36 min tests 📄log
✔️ cdddb32 #4 2024-08-19 16:06:04 ~2 min android 📦aar
✔️ cdddb32 #4 2024-08-19 16:06:15 ~2 min tests-rpc 📄log
✔️ cdddb32 #4 2024-08-19 16:06:23 ~2 min linux 📦zip
✔️ cdddb32 #4 2024-08-19 16:08:14 ~4 min ios 📦zip
✖️ cdddb32 #6 2024-08-19 16:40:16 ~36 min tests 📄log
✔️ f8fcc3a #5 2024-08-19 17:06:57 ~2 min android 📦aar
✔️ f8fcc3a #5 2024-08-19 17:07:05 ~2 min tests-rpc 📄log
✔️ f8fcc3a #5 2024-08-19 17:07:13 ~2 min linux 📦zip
✔️ f8fcc3a #5 2024-08-19 17:08:05 ~3 min ios 📦zip
✔️ f8fcc3a #7 2024-08-19 17:47:34 ~42 min tests 📄log
✔️ e34b2fb #6 2024-08-28 10:38:41 ~2 min tests-rpc 📄log
✔️ e34b2fb #6 2024-08-28 10:39:58 ~3 min linux 📦zip
✔️ e34b2fb #6 2024-08-28 10:40:25 ~4 min ios 📦zip
✔️ e34b2fb #6 2024-08-28 10:40:40 ~4 min android 📦aar
✔️ e34b2fb #8 2024-08-28 11:08:35 ~32 min tests 📄log
✔️ f2b2d18 #7 2024-08-29 14:06:23 ~2 min tests-rpc 📄log
✖️ f2b2d18 #9 2024-08-29 14:06:46 ~2 min tests 📄log
✔️ f2b2d18 #7 2024-08-29 14:07:45 ~3 min ios 📦zip
✔️ f2b2d18 #7 2024-08-29 14:07:54 ~3 min linux 📦zip
✔️ f2b2d18 #7 2024-08-29 14:09:44 ~5 min android 📦aar
✔️ 83dccb1 #8 2024-08-29 14:46:53 ~2 min android 📦aar
✔️ 83dccb1 #8 2024-08-29 14:47:01 ~2 min tests-rpc 📄log
✔️ 83dccb1 #8 2024-08-29 14:47:01 ~2 min linux 📦zip
✔️ 83dccb1 #8 2024-08-29 14:48:14 ~3 min ios 📦zip
✔️ 83dccb1 #10 2024-08-29 15:17:49 ~32 min tests 📄log
✖️ d599f6e #11 2024-08-30 15:12:16 ~55 sec tests 📄log
✔️ d599f6e #9 2024-08-30 15:13:26 ~2 min tests-rpc 📄log
✔️ d599f6e #9 2024-08-30 15:14:24 ~3 min linux 📦zip
✔️ d599f6e #9 2024-08-30 15:14:33 ~3 min ios 📦zip
✔️ d599f6e #9 2024-08-30 15:17:27 ~6 min android 📦aar
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 71bc099 #10 2024-08-30 15:14:59 ~1 min tests-rpc 📄log
✔️ 71bc099 #10 2024-08-30 15:17:05 ~2 min linux 📦zip
✔️ 71bc099 #10 2024-08-30 15:17:35 ~2 min ios 📦zip
✔️ 71bc099 #10 2024-08-30 15:19:54 ~2 min android 📦aar
✔️ 71bc099 #12 2024-08-30 15:46:13 ~32 min tests 📄log
✔️ 5f2bd7d #11 2024-08-30 18:55:28 ~2 min android 📦aar
✔️ 5f2bd7d #11 2024-08-30 18:55:33 ~2 min tests-rpc 📄log
✔️ 5f2bd7d #11 2024-08-30 18:55:37 ~2 min linux 📦zip
✔️ 5f2bd7d #11 2024-08-30 18:56:36 ~3 min ios 📦zip
✔️ 5f2bd7d #13 2024-08-30 19:24:40 ~31 min tests 📄log

@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch 2 times, most recently from abdb2b6 to 60b5499 Compare August 19, 2024 10:57
@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch 2 times, most recently from cdddb32 to f8fcc3a Compare August 19, 2024 17:04
@smohamedjavid smohamedjavid marked this pull request as ready for review August 19, 2024 18:36
Copy link
Contributor

@saledjenic saledjenic left a comment

Choose a reason for hiding this comment

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

Good catch!

@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch from f8fcc3a to e34b2fb Compare August 28, 2024 10:36
@smohamedjavid smohamedjavid requested a review from alaibe August 29, 2024 09:50
@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch 2 times, most recently from f2b2d18 to 83dccb1 Compare August 29, 2024 14:44
@@ -3376,6 +3379,18 @@ func (m *Messenger) handleSyncWatchOnlyAccount(message *protobuf.SyncAccount, fr
return nil, err
}

if m.config.accountsFeed != nil {
var eventType accountsevent.EventType
if acc.Removed {
Copy link
Contributor

@dlipicar dlipicar Aug 29, 2024

Choose a reason for hiding this comment

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

I have absolutely no idea how this sync thingy ends up actually adding or removing the account, are you sure we won't get 2 notifications (sent here and also wherever we had them before) for a single addition/removal?

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually was under the impression we had something like a "removeLater" flag when removing through sync, so the actual removal got done on the next app start, but I'm not super sure about that...

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that's not the case from what I experienced so far (from UI and checking the go code). When one of the synced devices adds/removes any accounts, it's immediately done, updates the DB and sends a signal to the UI of the same (that's why this function returns the acc).

protocol/messenger_backup_test.go Outdated Show resolved Hide resolved
protocol/messenger_builder_test.go Outdated Show resolved Hide resolved
services/ext/service.go Show resolved Hide resolved
@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch 2 times, most recently from d599f6e to 71bc099 Compare August 30, 2024 15:13
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
@smohamedjavid smohamedjavid force-pushed the fix/send-account-event-on-handling-backedup-accounts branch from 71bc099 to 5f2bd7d Compare August 30, 2024 18:53
@smohamedjavid smohamedjavid merged commit bd0464d into develop Aug 30, 2024
11 checks passed
@smohamedjavid smohamedjavid deleted the fix/send-account-event-on-handling-backedup-accounts branch August 30, 2024 19:28
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.

5 participants