PocketBase 0.40.6 + JS SDK 0.28.2; explicit JSON limits; setup steps for the new dashboard #28

Merged
reudy merged 2 commits from session/pocketbase-0.40 into main 2026-11-03 11:44:19 +01:00
Member

Upgrades PocketBase from 0.23.12 to 0.40.6 and the JS SDK from 0.26.9 to 0.28.2, fixes JSON field limits that were never applied, and rewrites the fresh-install steps for the new PocketBase dashboard.

⚠️ Deploy

  • Back up pb_data first. On its first start, 0.40 upgrades the database in place. To roll back, restore that backup; don't start 0.23 on upgraded data.
  • The image, port and user are the same as #27, so no other steps are needed.

Changes

  • docker-compose.yml: elestio/pocketbase:v0.40.6, pinned by digest.
  • pocketbase SDK ^0.28.2 in both apps and packages/shared. 0.27 and 0.28 only add handlers and fix pb.filter().
  • JSON field limits (new migration 1793400000_json_field_limits.js + pb_schema.json): six JSON fields had their limits under options.maxSize, which PocketBase ignores, so they used PocketBase's default. In 0.29 that default fell to 1MB, so on 0.40 a 1.5MB page that 0.23 saved is refused. The migration sets the intended limits explicitly (page and email blocks 2MB, site design 1MB, …). The largest real page is ~17KB, so this guards against a future surprise rather than fixing a current break.
  • README setup steps for the 0.40 dashboard:
    • The first superuser is created from the install link in the log.
    • Schema import: tick "Merge with the existing collections". It is off by default, and without it the import deletes users (tested), leaving only superusers able to sign in to the admin.
    • Also a new Upgrading to PocketBase 0.40 section.
  • AGENTS.md: versions, plus a rule that field settings go at the field's top level, never under options.

Tested

Each test ran on main (0.23.12 + SDK 0.26) and on this branch, on copies of real data, and the results were compared:

Test Result
Visible text of all 13 admin pages (as a users account) + public pages identical
Image upload through the admin: unicode filename, PNG/JPEG, thumbnails, wrong type and >20MB refused, library search incl. quotes, signed-out refused identical except the download filename is now quoted (a documented 0.40 change)
Import of all 3 files in backups/, every page renders, all 29 images load, re-export matches identical
Shop run through the hooks: bundle, time window, slot times, basket, hold, double-booking refused, code issue + apply, €0 checkout → order, order lookup, codes, privacy routes, delete-blocker identical
Stripe webhook: valid / bad / stale signature identical
Fresh install: empty volume → migrations → pb_schema.json import → shop run + all admin pages works; schema identical to 0.23 and to an upgraded existing install
svelte-check, both apps 0 errors (the warnings were there before and aren't SDK-related)

Already the case on 0.23.12 and left alone: on a fresh install's first start the privacy cron logs retention at startup failed … no rows in result set, because the collections don't exist yet. It's harmless (now noted in the README).

Not tested: a real card payment through stripe-mock, SMTP emails, and clicking through the new dashboard in a browser. The import steps were checked against the dashboard's code and the API it calls.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8

Upgrades PocketBase from **0.23.12 to 0.40.6** and the JS SDK from **0.26.9 to 0.28.2**, fixes JSON field limits that were never applied, and rewrites the fresh-install steps for the new PocketBase dashboard. ## ⚠️ Deploy - **Back up `pb_data` first.** On its first start, 0.40 upgrades the database in place. To roll back, restore that backup; don't start 0.23 on upgraded data. - The image, port and user are the same as #27, so no other steps are needed. ## Changes - `docker-compose.yml`: `elestio/pocketbase:v0.40.6`, pinned by digest. - `pocketbase` SDK `^0.28.2` in both apps and `packages/shared`. 0.27 and 0.28 only add handlers and fix `pb.filter()`. - **JSON field limits** (new migration `1793400000_json_field_limits.js` + `pb_schema.json`): six JSON fields had their limits under `options.maxSize`, which PocketBase ignores, so they used PocketBase's default. In 0.29 that default fell to 1MB, so on 0.40 a 1.5MB page that 0.23 saved is refused. The migration sets the intended limits explicitly (page and email blocks 2MB, site design 1MB, …). The largest real page is ~17KB, so this guards against a future surprise rather than fixing a current break. - **README setup steps** for the 0.40 dashboard: - The first superuser is created from the install link in the log. - Schema import: **tick "Merge with the existing collections"**. It is off by default, and without it the import **deletes `users`** (tested), leaving only superusers able to sign in to the admin. - Also a new *Upgrading to PocketBase 0.40* section. - AGENTS.md: versions, plus a rule that field settings go at the field's top level, never under `options`. ## Tested Each test ran on main (0.23.12 + SDK 0.26) and on this branch, on copies of real data, and the results were compared: | Test | Result | |---|---| | Visible text of all 13 admin pages (as a `users` account) + public pages | identical | | Image upload through the admin: unicode filename, PNG/JPEG, thumbnails, wrong type and >20MB refused, library search incl. quotes, signed-out refused | identical except the download filename is now quoted (a documented 0.40 change) | | Import of all 3 files in `backups/`, every page renders, all 29 images load, re-export matches | identical | | Shop run through the hooks: bundle, time window, slot times, basket, hold, double-booking refused, code issue + apply, €0 checkout → order, order lookup, codes, privacy routes, delete-blocker | identical | | Stripe webhook: valid / bad / stale signature | identical | | Fresh install: empty volume → migrations → `pb_schema.json` import → shop run + all admin pages | works; schema identical to 0.23 and to an upgraded existing install | | `svelte-check`, both apps | 0 errors (the warnings were there before and aren't SDK-related) | Already the case on 0.23.12 and left alone: on a fresh install's first start the privacy cron logs `retention at startup failed … no rows in result set`, because the collections don't exist yet. It's harmless (now noted in the README). Not tested: a real card payment through `stripe-mock`, SMTP emails, and clicking through the new dashboard in a browser. The import steps were checked against the dashboard's code and the API it calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8
agent added 2 commits 2026-11-03 10:44:24 +01:00
pb_schema.json had six JSON field limits under `options.maxSize`, which
PocketBase ignores since 0.23, so those fields used PocketBase's default.
That default dropped to 1MB in 0.29: on 0.40 a 1.5MB page that 0.23
saved is refused. Move the limits to the field's top level and add a
migration that sets them on existing installs (pages/email blocks 2MB,
globals 1MB, event categories 200KB, customer details 100KB).

Tested on 0.40.6: existing install (migration applied, 1.5MB page saves,
2.5MB refused at 2MB) and fresh install + pb_schema.json import; both
end with identical schemas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8
- docker-compose: elestio/pocketbase v0.40.6, digest-pinned (same port,
  user and layout as v0.23.12)
- pocketbase SDK ^0.28.2 in both apps and packages/shared (0.27/0.28
  are additions and pb.filter() fixes, nothing breaking)
- README: setup steps rewritten for the 0.40 dashboard: install link
  from the log, and tick "Merge with the existing collections" on
  schema import (the default deletes `users`); an upgrade section
  (back up first, data upgrade is one-way, what changed)
- AGENTS.md: versions; field settings go at the top level, not `options`

Compared with main (0.23.12 + SDK 0.26) on copies of real data: admin
and public page text, image upload, import of all three backups, the
shop flow via hooks, Stripe webhook signatures, and a fresh install
with pb_schema.json import all behave the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8
reudy merged commit 97b1da2433 into main 2026-11-03 11:44:19 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/domaino#28
No description provided.