Skip to content

writeDelete silently failing #706

@pavle99

Description

@pavle99
  • I've validated the bug against the latest version of DB packages

Describe the bug
The writeDelete method for directly changing the sync store silently fails and stops further execution.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the example project from tanstack DB: https://github.com/TanStack/db/tree/main/examples/react/projects
  2. Add the following below this line:
console.log("todoCollection size1", todoCollection.size)

todoCollection.utils.writeDelete(deletedTodo.id)

console.log("todoCollection size2", todoCollection.size)

return { refetch: false }
  1. Follow the README.md file to start the dev server
  2. Start the server and login as any user
  3. Add a couple of todos
  4. Try deleting one
  5. Notice that it will briefly flicker out (deleted) and then reappear and also notice that the "todoCollection size2" doesn't get logged to the console meaning the onDelete handlers execution stops at the line with .writeDelete but no errors get shown anywhere

Expected behavior

The todo gets deleted from the store and the execution continues after the writeDelete call.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Brave
  • Version 1.83.118

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