✨ 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".
This commit is contained in:
2026-11-29 17:03:42 +00:00
parent a2507d22d3
commit f63fe1b549
3 changed files with 212 additions and 1 deletions
+1 -1
View File
@@ -5,6 +5,7 @@ go 1.27
require (
github.com/go-chi/chi/v5 v5.3.2
github.com/google/uuid v1.6.0
github.com/pocketbase/dbx v1.12.0
github.com/pocketbase/pocketbase v0.40.6
github.com/spf13/cobra v1.10.2
modernc.org/sqlite v1.60.1
@@ -25,7 +26,6 @@ require (
github.com/mattn/go-colorable v0.1.16 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/ncruces/go-strftime v1.1.0 // indirect
github.com/pocketbase/dbx v1.12.0 // indirect
github.com/pocketbase/ozzo-validation/v4 v4.3.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cast v1.10.0 // indirect