Skip to content

Better handle invalid inputs - #242

Merged
eheikes merged 2 commits into
mainfrom
bad-input
Oct 6, 2026
Merged

eheikes merged 2 commits into
mainfrom
bad-input

Conversation

@eheikes

@eheikes eheikes commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Check for and stop bad input before it can affect database operations.

This also fixes two other problems:

  • ?replace=true used to delete data on bad input. It deleted the existing item before inserting the new one, so a typo in a label removed the old item and then failed. The checks now run before the delete.
  • Updates used to be half-applied. An update with a bad label saved the other fields and cleared the item's labels before failing. Now nothing changes.

Duplicate labels (e.g. ['work', 'work']) were also a 500, from a primary-key clash. They're now ignored, in both the database and the response, rather than rejected.

@eheikes
eheikes merged commit efaa25e into main Oct 6, 2026
9 checks passed
@eheikes
eheikes deleted the bad-input branch October 6, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant