Skip to content

[question] What's the recommended way to handle render exceptions caused by stale persisted cached data? #501

Open
@SimpleCreations

Description

@SimpleCreations

Let's say I'm using React + Apollo + apollo-cache-persist with a GraphQL backend. Here's the problem:

  1. Let's say the backend released a broken update, returning data that causes the app to crash
  2. The client caches this data
  3. The client uses the data to render UI
  4. The client crashes
  5. On the next launch, the client tries to use the stale data to render UI
  6. The client crashes
  7. Go back to number 5

In this scenario, the users are stuck with a failing web app/crashing mobile app, and the only solution (once a fix to the backend is pushed) for them is to clear their site data/reinstall the app.

What's the recommended way to solve this?
One idea I had so far is to catch render issues with an error boundary and clear the persisted cache in this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions