Skip to content

Validate Fields Early #137

Open
Open
@mcmah309

Description

I got into a state where

data['type'], data['id'], row['tx_id'], data['data']);

was failing since somehow data['id'] was an int. I didn't see an easy way to resolve this so I had to run

await db.execute("DELETE FROM ps_crud;");

To drop the queue. I believe this resulted from me accidentally writing something like

INSERT INTO table_name(id, ...) VALUES (random_int)

Instead of

INSERT INTO table_name(id, ...) VALUES (uuid())

Which messed up all of syncing, even if I deleted the original code/table. Ideally a mistake like this would never make it to production, but if it did, is there a better way to recover without losing user data? Or at least in this case, validate early so for essential fields these situations cannot occur.

It is worth noting that all subsequent inserts would not sync until ps_crud was dropped.

Activity

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

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