You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: reconcile code-defined collection types on cached bootstrap #1014
When CACHE_KV contains the versioned bootstrap marker, SonicJS restores the in-memory collection registry but skips autoRegisterCollectionDocumentTypes().
A newly added code-defined collection therefore appears in the admin UI, but lacks a corresponding document_types record.
Document-backed operations, including slug availability checks, then fail.
Reproduction
Tested at commit 646c75b2 with Node v22.22.0 and npm 10.9.4.
Start an app with CACHE_KV enabled, allowing _sonicjs_bootstrap_v<version> to be created.
Add and register a new code-defined collection without changing SONICJS_VERSION.
Restart the app and create content in the new collection.
Enter a value in its URL Slug field.
The content form loads, but slug validation requests return:
GET /api/content/check-slug?... 400 Bad Request
{"error":"Collection not found or not document-backed"}
The collection is present in the in-memory registry but absent from document_types.
Expected behavior
Cached bootstrap should reconcile registered collections with document_types, so newly added collections work with document-
backed APIs immediately after restart.
Activity