Giter VIP home page Giter VIP logo

Comments (15)

adrai avatar adrai commented on May 25, 2024 2

If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.

There are many ways to help this project πŸ™

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024 1

v1.0.18

from i18next-http-backend.

erasmo-marin avatar erasmo-marin commented on May 25, 2024 1

I confirm it works like a charm! awesome, thanks!

from i18next-http-backend.

jamuhl avatar jamuhl commented on May 25, 2024

https://github.com/i18next/i18next/blob/master/src/BackendConnector.js#L138 i18next core already does retry

from i18next-http-backend.

erasmo-marin avatar erasmo-marin commented on May 25, 2024

It's not working for me, If I block requests, it does nothing

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Is it a retriable status code?

https://github.com/i18next/i18next-http-backend/blob/master/lib/index.js#L65

from i18next-http-backend.

erasmo-marin avatar erasmo-marin commented on May 25, 2024

https://github.com/i18next/i18next-http-backend/blob/master/lib/index.js#L65

I get it, so the problem is that you expect to receive a status code. The problem is that network errors (client side) do not return status codes and fetch API will reject the promise. In such case, i18next is not retrying. That's the problem we are having. Network errors can be temporal, so I think i18next should retry if the fetch request is rejected anyways.

What do you think?

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Would changing this work for you?

image

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

I'm going to create a new patch release, you can try with.

from i18next-http-backend.

erasmo-marin avatar erasmo-marin commented on May 25, 2024

I think that will work!

from i18next-http-backend.

lenadss avatar lenadss commented on May 25, 2024

Hi guys,

Is there any possibility to configure that retry mechanism? For example to disable at all or to decrease retry attempts (if I'm not mistaken currently it is 5 by default https://github.com/i18next/i18next/blob/master/src/BackendConnector.js#L138)

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

It will not retry if your http status code is in this range: res.status >= 400 && res.status < 50

from i18next-http-backend.

markymc avatar markymc commented on May 25, 2024

I would also like the ability to configure the retry count limit.

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

I would also like the ability to configure the retry count limit.

This is done automatically in the i18next core...

from i18next-http-backend.

jamuhl avatar jamuhl commented on May 25, 2024

Feel free to add a PR setting that inside an option: https://github.com/i18next/i18next/blob/master/src/BackendConnector.js#L138

from i18next-http-backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.