Skip to content
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

Optionally retain request info for cancelled get requests #968

Open
jcranendonk opened this issue Nov 12, 2019 · 1 comment
Open

Optionally retain request info for cancelled get requests #968

jcranendonk opened this issue Nov 12, 2019 · 1 comment

Comments

@jcranendonk
Copy link
Contributor

When the last subscription to a GetResponse is disposed, the GetRequest unsubscribes from the DataSource observable and removes itself from the RequestQueue. Any information about pending/in-flight network requests is lost to Falcor at this point.

When using a DataSource that makes network requests that cannot be cancelled, Falcor may create multiple network requests for the same path query. Such a situation can occur when e.g. starting and cancelling Falcor get requests in a React component's lifecycle methods. This is not a bug, but a side effect of internal request cleanup.

I propose we add a flag to Falcor.Model and/or allow a readonly property on the DataSource interface to communicate to Falcor whether underlying requests can effectively be cancelled, and, if not, that GetRequests are retained on the RequestQueue even after all callbacks are removed (i.e. all subscriptions disposed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@jcranendonk and others