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!: leftovers work for sync fallback #5794

Merged
merged 10 commits into from
Sep 19, 2024
Merged

Conversation

qfrank
Copy link
Contributor

@qfrank qfrank commented Sep 3, 2024

This is a continue work to PR
2 Major changes in this PR:

  • removed the compatibility with v2.29, in other word, version below v2.30 won't be able to parse the sync code generated with this PR
  • add AC notifications when initiating the sync fallback

relate mobile PR

Copy link

github-actions bot commented Sep 3, 2024

Thank you for opening this pull request!

Looks like you have BREAKING CHANGES in your PR.
Please make sure to update status-desktop and status-mobile clients accordingly.

@status-im-auto
Copy link
Member

status-im-auto commented Sep 3, 2024

Jenkins Builds

Click to see older builds (50)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 5368b3f #1 2024-09-03 03:08:34 ~1 min tests 📄log
✔️ 5368b3f #1 2024-09-03 03:10:04 ~2 min tests-rpc 📄log
✔️ 5368b3f #1 2024-09-03 03:11:43 ~4 min linux 📦zip
✔️ 5368b3f #1 2024-09-03 03:12:00 ~4 min ios 📦zip
✔️ 5368b3f #1 2024-09-03 03:13:06 ~5 min android 📦aar
✔️ 9c847bb #2 2024-09-03 03:34:52 ~1 min tests-rpc 📄log
✖️ 9c847bb #2 2024-09-03 03:34:57 ~1 min tests 📄log
✔️ 9c847bb #2 2024-09-03 03:35:18 ~1 min android 📦aar
✔️ 9c847bb #2 2024-09-03 03:35:38 ~1 min linux 📦zip
✔️ 9c847bb #2 2024-09-03 03:36:39 ~2 min ios 📦zip
✔️ 837f682 #3 2024-09-03 03:47:05 ~1 min tests-rpc 📄log
✔️ 837f682 #3 2024-09-03 03:47:29 ~1 min android 📦aar
✔️ 837f682 #3 2024-09-03 03:48:03 ~2 min linux 📦zip
✖️ 837f682 #3 2024-09-03 03:48:09 ~2 min tests 📄log
✔️ 837f682 #3 2024-09-03 03:48:54 ~2 min ios 📦zip
✔️ 200389c #4 2024-09-03 08:13:18 ~1 min android 📦aar
✔️ 200389c #4 2024-09-03 08:13:47 ~2 min linux 📦zip
✔️ 200389c #4 2024-09-03 08:13:53 ~2 min tests-rpc 📄log
✔️ 200389c #4 2024-09-03 08:14:50 ~3 min ios 📦zip
✔️ 200389c #4 2024-09-03 08:43:17 ~31 min tests 📄log
✔️ 84df75e #5 2024-09-03 11:46:32 ~2 min android 📦aar
✔️ 84df75e #5 2024-09-03 11:46:53 ~2 min linux 📦zip
✔️ 84df75e #5 2024-09-03 11:47:03 ~2 min tests-rpc 📄log
✔️ 84df75e #5 2024-09-03 11:50:33 ~6 min ios 📦zip
✔️ 84df75e #5 2024-09-03 12:16:48 ~32 min tests 📄log
✖️ 11af278 #6 2024-09-03 20:14:17 ~58 sec tests 📄log
✔️ 11af278 #6 2024-09-03 20:15:26 ~2 min android 📦aar
✔️ 11af278 #6 2024-09-03 20:15:31 ~2 min tests-rpc 📄log
✔️ 11af278 #6 2024-09-03 20:15:39 ~2 min linux 📦zip
✔️ 11af278 #6 2024-09-03 20:16:28 ~3 min ios 📦zip
✔️ da30cca #7 2024-09-09 12:12:58 ~2 min tests-rpc 📄log
✔️ da30cca #7 2024-09-09 12:14:44 ~4 min linux 📦zip
✔️ da30cca #8 2024-09-09 12:14:46 ~3 min ios 📦zip
✔️ da30cca #8 2024-09-09 12:17:02 ~6 min android 📦aar
✔️ da30cca #7 2024-09-09 12:43:09 ~32 min tests 📄log
✔️ 1b4176c #8 2024-09-09 12:15:31 ~2 min tests-rpc 📄log
✔️ 1b4176c #8 2024-09-09 12:17:10 ~2 min linux 📦zip
✔️ 1b4176c #9 2024-09-09 12:18:21 ~3 min ios 📦zip
✔️ 1b4176c #9 2024-09-09 12:21:56 ~4 min android 📦aar
✔️ 1b4176c #8 2024-09-09 13:13:50 ~30 min tests 📄log
✔️ b501c88 #9 2024-09-10 10:12:13 ~2 min tests-rpc 📄log
✔️ b501c88 #10 2024-09-10 10:12:28 ~2 min android 📦aar
✔️ b501c88 #9 2024-09-10 10:12:34 ~2 min linux 📦zip
✔️ b501c88 #10 2024-09-10 10:13:20 ~3 min ios 📦zip
✔️ b501c88 #9 2024-09-10 10:42:10 ~32 min tests 📄log
✔️ 016595b #10 2024-09-16 07:23:44 ~2 min tests-rpc 📄log
✔️ 016595b #10 2024-09-16 07:25:43 ~4 min linux 📦zip
✔️ 016595b #11 2024-09-16 07:26:04 ~4 min android 📦aar
✔️ 016595b #11 2024-09-16 07:27:56 ~6 min ios 📦zip
✔️ 016595b #10 2024-09-16 07:54:05 ~32 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8c7d2f0 #12 2024-09-17 15:52:54 ~2 min android 📦aar
✔️ 8c7d2f0 #11 2024-09-17 15:53:02 ~2 min tests-rpc 📄log
✔️ 8c7d2f0 #11 2024-09-17 15:54:25 ~3 min linux 📦zip
✔️ 8c7d2f0 #12 2024-09-17 15:54:33 ~3 min ios 📦zip
✔️ 8c7d2f0 #11 2024-09-17 16:22:54 ~32 min tests 📄log
✔️ d5b2616 #13 2024-09-18 11:27:39 ~1 min android 📦aar
✔️ d5b2616 #12 2024-09-18 11:27:52 ~2 min linux 📦zip
✔️ d5b2616 #12 2024-09-18 11:28:08 ~2 min tests-rpc 📄log
✔️ d5b2616 #13 2024-09-18 11:31:25 ~5 min ios 📦zip
✔️ d5b2616 #12 2024-09-18 11:59:36 ~33 min tests 📄log

.gitignore Outdated Show resolved Hide resolved
protocol/messenger.go Outdated Show resolved Hide resolved
protocol/messenger.go Outdated Show resolved Hide resolved
protocol/messenger.go Outdated Show resolved Hide resolved
protocol/messenger_pairing_and_syncing.go Outdated Show resolved Hide resolved
@igor-sirotin
Copy link
Collaborator

cc @glitchminer looks like this is a good case for some user stories 🙂

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Looks good, though more than half the code is mine 🙈

@qfrank do you want to address Igor's comments or do you want me to do it?
nvm I did it :D

protocol/messenger.go Outdated Show resolved Hide resolved
protocol/messenger.go Outdated Show resolved Hide resolved
@jrainville
Copy link
Member

I added a commit with the review comment fixes. I also rebased and updated my status-desktop PR here: status-im/status-desktop#15820

It works again as expected

.gitignore Outdated Show resolved Hide resolved
@igor-sirotin
Copy link
Collaborator

@qfrank @jrainville are you still around this PR?
Looks like it needs some love around commit messages 😄

@qfrank qfrank force-pushed the feat/enable_sync_fallback branch 2 times, most recently from 8eea23b to da30cca Compare September 9, 2024 12:10
@qfrank
Copy link
Contributor Author

qfrank commented Sep 9, 2024

@qfrank @jrainville are you still around this PR? Looks like it needs some love around commit messages 😄

updated @igor-sirotin

@jrainville
Copy link
Member

@qfrank feel free to squash my commits if you want

qfrank and others added 7 commits September 16, 2024 12:47
Needed for status-im/status-desktop#15750

Adds an AC notification when the syncing fails and the user is prompted to use a seed phrase instead.
There is one notification for the initiator (created) and one for the old account (received).
Once the flow is completed, ie the receiver presses Enable and sync,  the notifications are deleted
@Parveshdhull
Copy link
Member

Hi @qfrank, rebased the PR - status-im/status-mobile#21090 (comment)

protocol/messenger.go Outdated Show resolved Hide resolved
@@ -1063,8 +1063,8 @@ func (api *PublicAPI) SyncDevices(ctx context.Context, name, picture string) err
return api.service.messenger.SyncDevices(ctx, name, picture, nil)
}

func (api *PublicAPI) EnableAndSyncInstallation(request *requests.EnableAndSyncInstallation) error {
return api.service.messenger.EnableAndSyncInstallation(request)
func (api *PublicAPI) EnableInstallationAndSync(request *requests.EnableInstallationAndSync) (*protocol.MessengerResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I understand, this is the only breaking change in this PR.

If you really think we should rename it, then:

  1. Mark EnableAndSyncInstallation as deprecated, but keep it working.
  2. Introduce EnableInstallationAndSync and update clients to use the new endpoint.

This way we can ensure clients are still compatible with the changes.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not fully aware of all the implications, but as I understood it, the breaking change it bigger than that. Once this is released, people will only be able to pair between 2.31 and up.

I guess it was not possible to keep backwards compatibility, otherwise Andrea would have thought of it.

As for renaming the API, both desktop and mobile are creating PRs at the same time, so I think it's fine to just rip the band aid right now and not keep an unused API?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it depends on the terminology of a breaking change that we should agree upon.
Let me discuss this with the @status-im/status-go-guild today, I'll be back with an answer in the evening.

Copy link
Member

Choose a reason for hiding this comment

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

We have 3 types of breaking change:

  • Breaking between versions (the type that we want to avoid the most)
  • Breaking of functionality (basically introducing a (or several) bug(s))
  • Breaking between status-go and client (potentially this case)

I think breaks between status-go and clients can be managed, as long as they are managed they are only a problem if someone has an old branch and doesn't rebase against the latest develop.

Copy link
Contributor Author

@qfrank qfrank Sep 18, 2024

Choose a reason for hiding this comment

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

I have added the old API back, can I get your approval now? 🙂 Your approval is valuable for me! @igor-sirotin

Copy link
Collaborator

Choose a reason for hiding this comment

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

@qfrank I'm not really saying that we should stick to the old function name.
But there's a way to make this carefully: create a new function and deprecate the old one. Then the switch to the new function name will be seamless 🙌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

create a new function and deprecate the old one

I've done this yesterday 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I merge it now? I'm waiting for your approval 🥹 @igor-sirotin

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh! I only read your comment and and didn't check the code 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no worries, we can create another PR if needed

Copy link
Member

@Samyoul Samyoul left a comment

Choose a reason for hiding this comment

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

Thank you @qfrank , I've gone through this and it all seems really nicely written.

@igor-sirotin igor-sirotin changed the title leftovers work for sync fallback fix!: leftovers work for sync fallback Sep 19, 2024
@qfrank qfrank merged commit f04a9a8 into develop Sep 19, 2024
11 checks passed
@qfrank qfrank deleted the feat/enable_sync_fallback branch September 19, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants