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

Notify subscribers on the next tick #82

Merged
merged 4 commits into from
Jun 11, 2021
Merged

Conversation

alex-mechler
Copy link
Contributor

cc @kidroca @marcaaron

Details

This updates subscribers of data changes on the next tick, rather than blocking on notifying subscribers.

Related Issues

Expensify/App#3485 (comment)
Expensify/App#3488 (comment)

Automated Tests

Existing automated tests cover these changes.

Linked PRs

Expensify/App#3535

@alex-mechler alex-mechler self-assigned this Jun 11, 2021
@alex-mechler alex-mechler requested a review from a team as a code owner June 11, 2021 17:25
@MelvinBot MelvinBot requested review from joelbettner and removed request for a team June 11, 2021 17:25
Julesssss
Julesssss previously approved these changes Jun 11, 2021
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Resolves the endless spinner issue on login. Even with the redirect to /r, this seems like a good improvement to me.

Copy link
Contributor

@marcaaron marcaaron 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, but curious if we want to also make a similar change for merge(), multiSet() and mergeCollection() ? There are a few other methods that set data and also were calling keyChanged() or keysChanged() async before kid roca's changes.

@alex-mechler
Copy link
Contributor Author

Ah good call Marc, I can test adding those. That might solve some of the other issues I am seeing.

@alex-mechler
Copy link
Contributor Author

Updated to notify the subscribers on the next tick for remove and multiset to match behavior from prior to the cache.

I did not notice any difference, however this better matches the prior behavior, and passes all tests.

@marcaaron marcaaron merged commit 1e82e59 into master Jun 11, 2021
@marcaaron marcaaron deleted the amechler-next-tick-notify branch June 11, 2021 18:20
@trjExpensify

This comment has been minimized.

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.

4 participants