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(data): Fix reachability debouncer causing delay on local inserts #2464

Merged
merged 7 commits into from
Jun 2, 2023

Conversation

tylerjroach
Copy link
Member

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:

How did you test these changes?
(Please add a line here how the changes were tested)

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tylerjroach tylerjroach requested a review from a team as a code owner June 1, 2023 21:09
@tylerjroach tylerjroach enabled auto-merge (squash) June 2, 2023 21:43
@tylerjroach tylerjroach merged commit 6e441f6 into main Jun 2, 2023
@tylerjroach tylerjroach deleted the tjroach/optimize-local-inserts branch June 2, 2023 22:57
@joekiller
Copy link
Contributor

I still really dislike the reachability test and think it does more harm than good especially for systems that have many models, 15+, as it'll cause the entire data store to cease admitting transactions during network transitions which is kinda ridiculous for an "offline store". I didn't like it when I saw go in. To me the further work to it exemplifies why it's not a good solution. It's too much of a hammer and smashes data store just to make that sync engine run when a very reasonable restart from within would do.

@tylerjroach
Copy link
Member Author

Hi @joekiller, this was put in place as we had a report that even in scenarios of no network, inserts for 100 items were taking around 25 seconds. This change improved local insertion time back to 200ms.

In it's new state, the debouncer acts like more of a cache. subscribing to the observable will immediately provide the current value, and will not transition to a new value unless the network has been in a stable state for 250ms.

I'd love to understand a bit more of your concerns here, especially "it'll cause the entire data store to cease admitting transactions during network transitions". Can you clarify this? As mentioned, this change no longer delays local insertions, which I do not believe was ever intended to begin with.

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