-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(datastore): Update outbox comparison logic to fix update versioning problems #12813
fix(datastore): Update outbox comparison logic to fix update versioning problems #12813
Conversation
commit 63507e6 Author: Aaron S <stocaaro@stocad.com> Date: Mon Jan 8 14:51:15 2024 -0600 fix(datastore): Consecutive updates bug fix commit 5492d52 Author: Aaron S <stocaaro@stocad.com> Date: Mon Jan 8 13:45:32 2024 -0600 Remove dead function commit 8af79b8 Merge: 3fd5f7d 4763b55 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Mon Jan 8 13:38:31 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit 3fd5f7d Merge: fe33aa9 d0911f5 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Mon Jan 8 12:58:07 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit fe33aa9 Author: Aaron S <stocaaro@stocad.com> Date: Mon Jan 8 12:31:42 2024 -0600 refactor: Test service fake, remove dead code commit 965c5b5 Merge: 10ccded 483bf03 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Fri Jan 5 16:39:30 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit 10ccded Merge: 409f0ab dc4cf29 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Fri Jan 5 10:45:07 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit 409f0ab Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Fri Jan 5 10:45:00 2024 -0600 Update packages/datastore/__tests__/conflictResolutionBehavior.test.ts Co-authored-by: David McAfee <mcafd@amazon.com> commit 61dfff8 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Fri Jan 5 10:44:49 2024 -0600 Update packages/datastore/__tests__/helpers/fakes/graphqlService.ts Co-authored-by: David McAfee <mcafd@amazon.com> commit 105fe37 Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 12:17:54 2024 -0600 Fix lint issues commit 5d59946 Merge: 0972d0f 46038f7 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Thu Jan 4 12:12:48 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit 0972d0f Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 11:59:48 2024 -0600 Update OCC tests so all external updates succeed commit b669961 Merge: 23b2ac0 44fdfe8 Author: Aaron S <94858815+stocaaro@users.noreply.github.com> Date: Thu Jan 4 11:27:42 2024 -0600 Merge branch 'main' into 04-consecutive-updates-take2 commit 23b2ac0 Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 11:13:20 2024 -0600 Disambiguate names commit 08e60d5 Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 11:10:21 2024 -0600 merge commit 520b8fe Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 11:09:12 2024 -0600 merge commit 1ec13d7 Author: Aaron S <stocaaro@stocad.com> Date: Thu Jan 4 11:02:38 2024 -0600 Refactor to align events with sample app and clarify fake service count interface commit f1f883b Author: Aaron S <stocaaro@stocad.com> Date: Thu Dec 21 16:39:25 2023 -0600 Updates from comments commit f197d77 Author: Aaron S <stocaaro@stocad.com> Date: Wed Jan 3 11:04:17 2024 -0600 test(datastore): Refactor test names and make subscriptions more latent / realistic commit 354ab21 Author: Aaron S <stocaaro@stocad.com> Date: Wed Jan 3 11:03:06 2024 -0600 Update packages/datastore/__tests__/helpers/UpdateSequenceHarness.ts Co-authored-by: David McAfee <mcafd@amazon.com> commit 876181e Author: Aaron S <stocaaro@stocad.com> Date: Wed Jan 3 11:02:10 2024 -0600 Updates from comments commit 318549d Author: Aaron S <stocaaro@stocad.com> Date: Wed Dec 20 12:05:44 2023 -0600 Improve comments and get rid of unused features
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.
馃檶馃徎
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.
There are a couple tests that still read like they have unexpected results. E.g., this line here.
Unless I'm being dense, if those are expected not to change, can we document why the unexpected looking results on those are actually the correct behavior?
packages/datastore/src/util.ts
Outdated
* @param valB - The object that may be an equal superset of valA. | ||
* @returns True if valA is a equal subset of valB and False otherwise. | ||
*/ | ||
export function objectMatches( |
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.
The docstring helps, but the naming here is misleading, IMO. This might be low risk in this codebase, but is there semantic/purposeful naming we can give this? Or something more verbose (even at the risk of looking like Java).
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.
Alright. Chased names around for a bit and settled on directedValueEquality
, with a input names changed to fromObject
and againstObject
(which I found to be slightly clearer than source and target, being unable to decided with should be the root object for the directed equality comparison.
Regarding the unclear test. I had two choices. This test gets clearer if the external update title "wins" and is left at the end of the test. I think the test is more interesting / covers a deeper scenario with more nuance as written, so I opted to add a detailed comment instead of altering the test for clarity. |
Description of changes
Outcome:
_version
maintenance.Issue #, if available
Description of how you validated changes
Validated by updating tests and testing against sample apps manaully for both Automerge and OCC usecases
Related changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.