-
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.
Updating connection handler to be able to deal with streamed edges th…
…at are already in memory Summary: Fix fix fix tl;dr: *Remembering the page_info of previously streamed pages causes ConnectionHandler to prematurely update the end cursor and not accept more than the initial count of items for the connection.* Original Post: https://fb.workplace.com/groups/relay.support/permalink/24536709345951016/ # Debugging: On reload of pages/connections that have been in memory before it seems to recall/remember the pageInfo of those. https://www.internalfb.com/code/fbsource/[8aede072216b66fd056bd12e1de7a463250acb3c]/xplat/js/RKJSModules/Libraries/Relay/oss/relay-runtime/handlers/connection/ConnectionHandler.js?lines=67 Usually, with stream_connection it doesn’t know the page_info till the end of the stream (its null until it comes back deferred). But on second reload of the exact same page, it looks up the same key, and finds the page info from last time causing it to set the end cursor prematurely. https://www.internalfb.com/code/fbsource/[8aede072216b66fd056bd12e1de7a463250acb3c][history][blame]/xplat/js/RKJSModules/Libraries/Relay/oss/relay-runtime/handlers/connection/ConnectionHandler.js?lines=221 This causes all subsequently streamed edges to fail due to this call: https://www.internalfb.com/code/fbsource/[8aede072216b66fd056bd12e1de7a463250acb3c][history][blame]/xplat/js/RKJSModules/Libraries/Relay/oss/relay-runtime/handlers/connection/ConnectionHandler.js?lines=150 Remembering the page_info of previously streamed pages causes ConnectionHandler to prematurely update the end cursor and not accept more than the initial count of items for subsequent pages in the connection. This modifies the logic to be able to accept pages that either agree on after/end cursor or matching end cursors. Reviewed By: keoskate, fred2028 Differential Revision: D45586049 fbshipit-source-id: 34ac5e342ca0975f2ad841a382ffde4ff5fc6bd3
- Loading branch information
1 parent
92fd38c
commit 6f30869
Showing
2 changed files
with
200 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