Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Unexpected fallback to cache when a render fails #261

Open
Tiagoperes opened this issue Oct 2, 2020 · 0 comments
Open

Unexpected fallback to cache when a render fails #261

Tiagoperes opened this issue Oct 2, 2020 · 0 comments
Labels
bug Something isn't working low priority Not solving this for now

Comments

@Tiagoperes
Copy link
Contributor

Beagle Web version: 1.2.0

Steps To Reproduce

  1. Fetch a view that contain errors in its JSON, i.e., there will be errors when rendering it.
  2. The error will make Beagle attempt to load the view from the cache and render it again.
  3. The same error will happen when rendering the view.
  4. The error component will finally get rendered.

The current behavior

As stated in step 2, Beagle will attempt to load the view from the cache because an error occurred when rendering the view returned by the network request. The cached view is the same as the remote view, we just updated it. We know there will be a rendering error, we shouldn't try to render it again.

The expected behavior

The ErrorComponent should be rendered immediately after the first rendering error.

Solution

The problem is that Beagle follows the rule below:

"Try to fetch the view from the server and render it, if it fails, try to fetch it from the cache and render it, if it still fails, render the error component."

When it should actually be:

"Try to fetch the view from the server, if it fails, try to fetch it from the cache, if it still fails, render the error component, otherwise, render the view."

i.e. we should only retry network or cache errors and never the render itself.

Priority

The rendering process is extremely fast, the final user will never see this useless additional render, so this is not a priority, but we should still fix it.

@Tiagoperes Tiagoperes added the bug Something isn't working label Oct 2, 2020
@Tiagoperes Tiagoperes added the low priority Not solving this for now label Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working low priority Not solving this for now
Projects
None yet
Development

No branches or pull requests

1 participant