4 Commits
Author SHA1 Message Date
aksdb 590758dfb6 🐛 Bound hours per week on settings
The field accepted any number from 0.01 up, so a typo or a bad client
could store more hours than a week has and break every expected value
derived from it. The initial migration limits hours_per_week to 168; no
database was ever deployed with the previous version of the migration.
2026-12-01 16:54:32 +01:00
aksdb 9f0700fa1c 🐛 Reject invalid changes instead of failing the whole sync batch
Every whitelisted field was written, so a tombstone or a partial change
without the required fields failed the validation and rolled back the
whole batch with 400, which a client would retry forever. Only the keys
present in the change are set now, a change is validated on its own and
answered as invalid with the message, and a tombstone for an unknown
row is answered ok without writing anything.
2026-12-01 16:41:57 +01:00
aksdb fcb008dd57 🧪 Test sync push endpoint
Covers create, update, stale, forbidden and readonly answers, the
guard for the last settings row, request validation, the missing auth
token and that a failing change rolls back the whole batch. Also
checks that regular users cannot write synced collections over REST
and that superuser writes keep the owner and rev consistent.
2026-11-29 17:03:45 +00:00
aksdb f63fe1b549 ✨ Add batch push endpoint for synced collections
POST /api/sync/push applies up to 500 client changes of a signed-in
user in one transaction. Every change is answered with ok, stale,
forbidden or readonly, so the client can reconcile its local state
with the server state.

closed_days and closed_weeks are answered as readonly because only
the server computes them. The last remaining settings row of a user
cannot be deleted either; such a change is answered as stale, which
clients already treat as "server wins".
2026-11-29 17:03:42 +00:00