-
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.
Summary: Currently, there are only two record stores in `RelayStoreData`: - `queuedStore` reads through optimistic, "true", and cached data. - `recordStore` reads only "true" data. All store update operations (excludes preparing data for containeres) currently use `recordStore`, allowing diffing/writing to operate without respect for optimistic payloads. Also, these record stores store not only records, but also the mapping from root fields to data IDs. ---- Since we use the `recordStore` when writing payloads, if we encounter a root field that does not exist as "true" data, we will generate a new client ID. If we had previously vended a data ID using `queuedStore`, containers will already have a reference to the data ID from cached data. This inconsistency causes problems when containers need to refetch data when new data is avaialable (e.g. via `setVariables`). This fixes the problem by creating a new `cachedStore` that allows reading through all both "true" and cached data. This allows the mapping from root fields to data IDs to be consistent throughout the life of an application (from rendering cached data to rendering newly fetched "true" data). Reviewed By: josephsavona Differential Revision: D2698788 fb-gh-sync-id: fd41bcaf4f843aad3db47a9b9c76c1d52481fc52
- Loading branch information
Showing
6 changed files
with
190 additions
and
55 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
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