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(#7250): race condition in loading contacts #8234

Merged
merged 9 commits into from
May 15, 2023

Conversation

latin-panda
Copy link
Contributor

@latin-panda latin-panda commented May 11, 2023

Description

Stores the contact ID we want to fetch. Then as promises resolve, it checks that the contact we want to load is the same as from the data we had retrieved.

#7250

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@latin-panda
Copy link
Contributor Author

@ngaruko and @dianabarsan

There's a job before on this topic. The only part where we still need to check for the ID that it's loading is after the first retrieve of data.

Please have a look and let me know your thoughts.

@latin-panda latin-panda marked this pull request as ready for review May 12, 2023 01:22
webapp/src/ts/actions/contacts.ts Outdated Show resolved Hide resolved
webapp/src/ts/effects/contacts.effects.ts Outdated Show resolved Hide resolved
Copy link
Member

@dianabarsan dianabarsan left a comment

Choose a reason for hiding this comment

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

oops I accidentally hit enter without filling the textarea!

Thanks a lot for this change, @latin-panda ! It's great! I added a small request to keep code cleaner and a renaming suggestion.

Copy link
Contributor

@ngaruko ngaruko left a comment

Choose a reason for hiding this comment

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

Good work! Since it was affecting e2e and hard to reproduce, I guess we don't need to write any more e2e test, just monitor that we are getting stable builds from now on 🤞

@latin-panda
Copy link
Contributor Author

@ngaruko I found the steps to reproduce the issue reliably; it's in the ticket.

Copy link
Member

@dianabarsan dianabarsan left a comment

Choose a reason for hiding this comment

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

Nice, these things are such a pain. i think we should definitely normalize this kind of flow in all other areas where you could get subsequent select events, before initial ones finish executing.

@latin-panda latin-panda merged commit fc710e0 into master May 15, 2023
@latin-panda latin-panda deleted the 7250-Race-condition-in-loading-contacts branch May 15, 2023 09:11
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.

3 participants