Skip to content

Multiple calls to collection.utils.writeInsert causes a duplicate key error #458

@byudaniel

Description

@byudaniel

Reproduction on StackBlitz. (Click "Add Todo" multiple times quickly.)

If I attempt to call collection.utils.writeInsert while a previous transaction is still in progress the commit will fail with a duplicate key error and then the transaction fails to rollback. This happens both when called within an onInsert function and outside of it.

In this case I'm testing out a scenario where I avoid an expensive refetch, but modify the local db directly, similar to this example.

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