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

fix(persisted): Add dev warning for persisted-miss results for an already persisted-miss errored operation (repeated retries) #3442

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Dec 1, 2023

Closes #3441

Summary

When a persistedExchange() sees a persisted-miss error, it will retry the operation while disabling persisted serialization using the miss: true flag. However, we had no guard to check whether miss: true was already set.

This meant that if an API/exchange erroneously keeps replying with persisted-miss errors then persistedExchange() wouldn't stop retrying the operation.
When an ssrExchange() on the server-side caches this error, this is made worse, since ssrExchange's results are synchronous and this hence causes an infinite loop.

A development-time warning has been added that explicitly tells people that this is what's going on and how to resolve it.

Set of changes

  • Add failing test for repeated persisted-miss errors
  • Handle & Ignore repeated persisted-miss errors and log development warning

Copy link

changeset-bot bot commented Dec 1, 2023

🦋 Changeset detected

Latest commit: 3848395

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-persisted Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten changed the title Fix/persisted warning fix(persisted): Add dev warning for persisted-miss results for an already persisted-miss errored operation (repeated retries) Dec 1, 2023
@kitten kitten merged commit f7684a0 into main Dec 1, 2023
13 checks passed
@kitten kitten deleted the fix/persisted-warning branch December 1, 2023 16:08
This was referenced Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RangeError: Maximum call stack size exceeded when using persistedExchange in front of ssrExchange
2 participants