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

RCORE-821 Update user metadata atomically #4876

Merged
merged 4 commits into from
Sep 3, 2021

Conversation

jbreams
Copy link
Contributor

@jbreams jbreams commented Aug 25, 2021

What, How & Why?

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)

@jbreams jbreams marked this pull request as ready for review September 2, 2021 20:06
@jbreams jbreams requested a review from ironage September 2, 2021 20:07
@jbreams jbreams force-pushed the jbr/atomically_update_syncuser_metadata branch from 5896019 to 5b59473 Compare September 2, 2021 20:12
REALM_ASSERT(state == State::Removed);
return;
case State::LoggedIn:
if (m_state == State::LoggedIn) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is always true because the switch is already on m_state. Can you double check the logic in each of these cases, did you mean to switch on state instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I've simplified this a bunch and added a unit test that makes sure these code paths are exercised.

@jbreams jbreams requested a review from ironage September 3, 2021 18:49
Copy link
Contributor

@ironage ironage left a comment

Choose a reason for hiding this comment

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

LGTM. Just needs a change log note about the race that this fixes 👍

@jbreams jbreams force-pushed the jbr/atomically_update_syncuser_metadata branch from 12510df to 0bbecf8 Compare September 3, 2021 19:06
@jbreams jbreams merged commit 2323c0a into master Sep 3, 2021
@jbreams jbreams deleted the jbr/atomically_update_syncuser_metadata branch September 3, 2021 20:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants