-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feature: Change the retain function in RelayModernStore #2829
Comments
Hmm, we're actively exploring new features to allow finer grained control of cache invalidation, and also looking at changes to the Store API to support a new approach to loading connections. We considered query-level TTL but aren't convinced that's the right long-term API, so I think we need to understand the use-case better - probably the first step is documenting our thinking around cache invalidation so that you and others can give feedback. |
Hi @josephsavona, I have noticed many changes in the management of the Store and I would like to discuss some of its aspects before all the new experimental features become official.
What I ask is to make all the objects that guarantee the consistency of the Store of objects of type MutableRecordSource and configurable. (I am available to perform the PR) |
Hi @morrys, it sounds like the main theme of your request is that you want to be able to override (and access) all of the Store's data, not just the Overall, though, I think writing your own Store is the best option. We intentionally defined a Note that we have some upcoming APIs around data-invalidation that @jstejada is building out, which we think can sometimes be more flexible than per-query TTL, especially when combined with the release buffer size. I'd encourage you to follow along on those commits! |
I'm going to close as we won't proceed with this change as-is, but feel free to continue the discussion here - we're definitely excited to see your and others work on supporting the use of Relay when offline or in poor network conditions! |
@josephsavona @jstejada Did the changes you alluded to land? |
You can use data invalidation since v8 (https://github.com/facebook/relay/releases/tag/v8.0.0) |
@sibelius the invalidation of the store is very different from the TTL, the invalidation allows you to define what should be considered stale while the TTL define what should be considered available. |
Reviewed By: jstejada Differential Revision: D20546066 fbshipit-source-id: a064ac1ca3480f38f1e7cc13c0f200194dd16fe0
yes, we added a global per-environment query ttl value, which will determine how much time need to pass from the moment a query was written to the store before it is considered stale (similar to as if it had been invalidated with data invalidation) |
I wanted to propose to modify the retain function in RelayModernStore so that it can receive the following information:
as is
to be
This change allowed me to extend the store and implement the TTL management of the queries (we can expect to open an issue to bring this management natively in relay).
Thanks,
Lorenzo
The text was updated successfully, but these errors were encountered: