-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RelayPublishQueue: applied selector store updates are not applied cor…
…rectly during rebase (#2489) Summary: Fixes an issue with sequential optimistic mutation payloads (not updaters) where a field update from an earlier payload could be overwritten with the *original* value if the same record happened to be updated in a subsequent payload. This happened because the helper `copyFieldsFromRecord` was copying *all* fields from the base version of the record, rather than only updating new fields from the input record. The PR added new test cases here, the fix on top of that is to update copyFieldsFromRecord to only create a backup record but not re-copy fields from that record to the sink. -- original pr -- Added some tests that show expected/unexpected behavior I encountered. Suppose the publish queue has two applied optimistic updates that touch different fields on the same record. If I `RelayEnvironment#commitPayload()`, a backup rebase is executed to commit the payload. During this backup rebase, the second applied optimistic update can wipe the first applied optimistic update. Pull Request resolved: #2489 Reviewed By: kassens Differential Revision: D13914926 Pulled By: josephsavona fbshipit-source-id: 8bbab97a9117af6387e0e60f7b0dbd2454621d94
- Loading branch information
1 parent
7deeb7e
commit 55ce137
Showing
4 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters