Giter VIP home page Giter VIP logo

Comments (5)

guilhermearaujo avatar guilhermearaujo commented on May 25, 2024 1

Alright then. Things are a bit clearer now, and I sort of know how to investigate it further, I'll close this.

from malibu.

vadymmarkov avatar vadymmarkov commented on May 25, 2024

Hey @guilhermearaujo.

I found that "Error Domain=Malibu.NetworkError Code=8" is actually noDataInResponse by doing print(NetworkError.noDataInResponse as NSError).

In the last two released we fixed a couple of issues related to ETags: https://github.com/hyperoslo/Malibu/pull/94 and https://github.com/hyperoslo/Malibu/pull/97. Could it be that you're getting 304 Not Modified for some of your requests? If it so, try to disable Etags functionality if 304 is not supposed to be handled in your app.

from malibu.

guilhermearaujo avatar guilhermearaujo commented on May 25, 2024

Hi @vadymmarkov,
That does seem to be the problem, however it still seems a bit weird:

Prior to #97, the default behaviour for ETag Policy was enabled. This PR changed it to be disabled, and my app does not override it.
Therefore, my app requests (using 6.4.0) should never include the ETag header, I suppose, and consequently, the back-end should not respond with 304.

Is this correct or am I missing a point here?

Update:
I was wrong: the collapsed code made me misinterpret the changes.
GET requests were already supposed to have ETags enabled, and I believed that after these changes they now do work as intended.

from malibu.

guilhermearaujo avatar guilhermearaujo commented on May 25, 2024

Another thing that I haven't understood yet:
Some users reported that the content wouldn't load some times. It kind makes sense if the app gets a 304, but has no cache (or is not using the cache as it should) to complete the promises.

But in my tests, performing the exact same requests, using debug and release builds, I could not reproduce a single error like their reports.

Why isn't if failing consistently? Is it possible that the cache is storing the ETags, but has lost (or corrupted?) the data?

from malibu.

vadymmarkov avatar vadymmarkov commented on May 25, 2024

It's hard to say why it isn't failing consistently. You can test ETags by doing the same request multiple times and inspecting the status code. You can also try to clear ETags storage Malibu.clearStorages() to start from the clean state.

from malibu.

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.