Skip to content

configurable keyPath for people having existing records #24

@ghost

Description

Hi,

Please read the edit below.

There is a bug which prevents deletion of records from the store:
createTombstone gets called with the user defined record: https://github.com/paldepind/synceddb/blob/master/client/src/utils.js#L116

But it has a hard coded scheme, which expects properties like key and version: https://github.com/paldepind/synceddb/blob/master/client/src/utils.js#L162

So in my stores, my primary key is id and not key, so when the tombstone gets put into the store, a new record is created (with a new id), which prevents the deletion from being noticed.

Possible solution: Pass the primary key field name and its value to createTombstone.

Thank you for your great work!

Edit: I just noticed that a property with name key seems to be generated automatically for newly created records. I'm using a db with existing entities, so it doesn't have that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions