-
Notifications
You must be signed in to change notification settings - Fork 169
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
Sync access token refreshes shouldn't extend SyncSession lifetime #8064
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pointing at a bigger lifecycle problem because the session being kept alive should result in it being reused by the new Realm, but I don't see any reason why this workaround would cause problems.
Yeah, I agree. The fix looks good though. |
I think this fix is probably correct even if we also fixed the lifecycle issue. I guess if we wanted to become inactive and we were waiting for an access token we could become Dying instead of Inactive and then when we came back to re-open the sync session we could revive the session then? |
Maybe the root lifecycle issue is that this line is just wrong
|
I think we should merge this fix before trying larger scale changes to the lifecycle of SyncSession. @danieltabacaru does this lgtm? the test failures are from macos machines failing while invoking cmake 😞 . |
Pull Request Test Coverage Report for Build jonathan.reams_3577Details
💛 - Coveralls |
Only test failure is from an existing build issue. |
What, How & Why?
This fixes an issue discovered in a HELP ticket. If you open a synchronized realm and it needs to refresh its access token, and that refresh operation doesn't complete before the realm is closed, the lifetime of the sync session will be extended until the refresh is complete. If you open the realm again before that refresh is complete, then you'll have two sync sessions both try to start synchronizing the realm when the refreshes do complete, and that will crash the process with a MultipleSyncAgents exception.
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed