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

(retry) - @urql/core@>2.3.6 and retryExchange error in retryIf #2280

Closed
frederikhors opened this issue Feb 15, 2022 · 5 comments · Fixed by #2287
Closed

(retry) - @urql/core@>2.3.6 and retryExchange error in retryIf #2280

frederikhors opened this issue Feb 15, 2022 · 5 comments · Fixed by #2287
Labels
bug 🐛 Oh no! A bug or unintented behaviour. needs more info ✋ A question or report that needs more info to be addressable

Comments

@frederikhors
Copy link
Contributor

urql version & exchanges: "@urql/core": "2.4.1"

Steps to reproduce

Upgrading from "@urql/core": "2.3.6" to "2.4.1" I'm having issues with my app when 401 occurs.

The code

import type { RetryExchangeOptions } from "@urql/exchange-retry/dist/types/retryExchange";
import { setClient, dedupExchange, fetchExchange } from "@urql/svelte";
import { offlineExchange } from "@urql/exchange-graphcache";
import { persistedFetchExchange } from "@urql/exchange-persisted-fetch";
import { retryExchange } from "@urql/exchange-retry";

const retryOptions: RetryExchangeOptions = {
  initialDelayMs: 2000,
  maxDelayMs: 10 * 1000,
  maxNumberAttempts: 10,
  retryIf: (err: CombinedError): boolean => {
    console.log("The error is not here anymore! err:", err);

    // I cannot use err here...

    return false;
  },
};

// ...

const exchanges = [
  dedupExchange,
  offlineExchange({/*...*/}),
  retryExchange(retryOptions),
  persistedFetchExchange({ preferGetForPersistedQueries: true }),
  fetchExchange,
];

Am I the problem?

@frederikhors frederikhors added the bug 🐛 Oh no! A bug or unintented behaviour. label Feb 15, 2022
@kitten
Copy link
Member

kitten commented Feb 16, 2022

This could be related to this change, but I don't think there's enough for me here to immediately confirm that, unless @JoviDeCroock recognises rather spontaneously what this may be 😄 #2210

@kitten kitten added the needs more info ✋ A question or report that needs more info to be addressable label Feb 16, 2022
@kitten kitten changed the title @urql/core 2.4.1 and retryExchange's retryIf (retry) - @urql/core@>2.3.6 and retryExchange error in retryIf Feb 16, 2022
@frederikhors
Copy link
Contributor Author

@kitten if you have an app with @urql/core@>2.3.6 you can try to remove cookies or whatever is your auth system and the problem arises.

@JoviDeCroock
Copy link
Collaborator

JoviDeCroock commented Feb 18, 2022

This should be fixed in @urql/core 2.4.2 by the #2287 PR

@JoviDeCroock JoviDeCroock linked a pull request Feb 18, 2022 that will close this issue
@frederikhors
Copy link
Contributor Author

I'll try in a few minutes.

@frederikhors
Copy link
Contributor Author

It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Oh no! A bug or unintented behaviour. needs more info ✋ A question or report that needs more info to be addressable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants