Skip to content

UI cleared/replaced on optimistic mutations instead of updating properly #1010

@Toba-bonjour

Description

@Toba-bonjour
  • I've validated the bug against the latest version of DB packages

Describe the bug
For all "optimistic" or "offline" INSERT actions, the UI replaces the existing todos with the inserted one.
For all "optimistic" or "offline" UPDATE or DELETE actions, the UI is entirely cleared.
In both cases, I have to wait for a refresh or manually refresh it.

To Reproduce
I've created a minimalistic repo with a todo example to hopefully illustrate my issue.
https://github.com/Toba-bonjour/Tanstack-DB-Issue

Expected behavior
Displaying the added/updated/deleted data to the UI.

Desktop:

  • OS: MacOS Sonoma 14.6.1
  • Browser: Firefox
  • Version 146.0 (aarch64)

Additional context
As Kyle Mathews suggests, I FW this post from Discord.

I've asked multiple questions to Claude Code and tweaked a lot of options, but I can't figure out what I'm doing wrong or if it's a bug.

I'm using direct writes as my server will always returns fresh data.

By offline I mean using the Offline executor.
By optimistic I mean using { optimistic: true } as metadata.

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