Skip to content

Optimistic Update: Failed to Rollback After Error #30426

Open
@Us3r-gitHub

Description

Environment

Nuxt project info:


  • Operating System: Linux
  • Node Version: v18.20.3
  • Nuxt Version: 3.15.0
  • CLI Version: 3.17.2
  • Nitro Version: 2.10.4
  • Package Manager: npm@10.2.3
  • Builder: -
  • User Config: default
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Here's a minimal example to reproduce the issue:
StackBlitz Link

This example simulates a server error by not sending a payload. It should trigger an optimistic update failure and invoke the onResponseError hook.

Describe the bug

According to the Nuxt documentation on optimistic updates.

However, I'm experiencing an issue where the state fails to roll back after triggering a server error. To verify, you can check the current data length. This results in the UI reflecting the incorrect optimistic update, leaving the application in an inconsistent state.

I've created a minimal reproduction to demonstrate the issue. Any assistance in resolving this or providing further guidance on handling optimistic updates during failures would be greatly appreciated.

Additional context

No response

Logs

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions