Repository navigation
test(app-shell): pin the four remaining /layers reads' 404 as "never published" (objectui#11799) - #12026
Merged
Conversation
…published" (objectui#11799) The four GET /meta/:type/:name/layers reads objectui#11892 and objectui#11928 left open cannot be skipped with what their editors hold. The framework keeps its 404 for a name with no stored layer, the author included (objectstack-ai/objectstack#22397, answer (a)), and MetadataClient.layered() already resolves that 404 as an envelope with every layer null, so none of these reads raises an error for it. Pins, each over the real editor and a real MetadataClient on an in-memory server answering as the framework does: - the metadata edit page's first load of a draft-only item: no error, no lock banner, no reset/delete control, Layers sheet with no overlay; controls: a published item's layers are used, a 5xx shows the load error; - the embedded item editor: opening sends no read; controls: a published parent's save splices into its layers, a 5xx is the save's error; - the permission matrix's package-door save re-read of a "+ New" set: 404, saved over its own slice, no refusal; controls: a published set keeps other packages' rows, a 5xx still refuses; - the list-view panel, a view that exists nowhere: 404, no failure, the canvas shows the view the first edit creates; control: a 5xx is the load failure. Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11799
Clause-②: no
What this does
This takes the card's last remainder: the four
GET /meta/:type/:name/layersreads that objectui#11892 and objectui#11928 kept. objectstack-ai/objectstack#22397 was answered (a), by design: the framework keeps answering 404 for a name with no stored layer, the author included. Triage's unlock on this card asks each read to skip/layerswhere the editor already knows the item is draft-only. Otherwise the read takes its 404 as "never published", with no error state, and errors are not suppressed in general.I measured each read on
main6694abe, over the real editor and a realMetadataClienton an in-memory server that answers as the framework does:MetadataResourceEditPageload effect)noneand the no-baseline diff.EmbeddedItemEditordoSave)MetadataDetailDrawerandRelatedPanel, which are outside this claim's surface.doSave)useObjectListViewDraftload)listViewsis not the stored-view answer (seat 1's measurement on objectui#11928).No executable code changes.
MetadataClient.layered()already resolves a 404 as an envelope with every layer null and never rejects on it, so none of the four reads raises an error state for a draft-only item. A 5xx still throws and still shows its error. This PR pins that behaviour for each read, with the controls the dispatch asked for. No REST answer, export, prop, type member or pack key changes.Pins
All of them run over the real editor and a real
MetadataClienton the in-memory server. Requests and their statuses are counted on that server.ResourceEditPage.layersUnsaved-11799.test.tsx, new describe, 4 tests:/layers(404) and no error, lock banner or reset/delete control, and the Layers sheet shows overlaynone;env); a published item locked by its layers shows the lock banner from that answer; a 5xx shows "Failed to load …" even with a draft in hand.EmbeddedItemEditor.layersRead-11799.test.tsx, new file, 3 tests:PermissionMatrixEditor.layersUnsaved-11799.test.tsx, new describe, 3 tests, through the real client. The existingpackageDoorRereadRefusalpins mocklayered, so these are the first to cover the client's real 404 handling here.ObjectListViewInspector.layersUnsaved-11799.test.tsx, new describe, 2 tests:/layers(404) and no failure, and the canvas shows the seeded view;Changeset:
.changeset/11799-layers-draft-only.md, with empty frontmatter (no release) because the change is tests only. The dispatch asked for apatch. With no executable change, a patch would release the fixed group for nothing.check-changeset-presenceaccepts the empty frontmatter as the declaration.Verification, on head d761384
pnpm exec vitest run --maxWorkers=2over the four pin files:Test Files 4 passed (4),Tests 22 passed (22).turbo run build --filter=@object-ui/app-shell^... --concurrency=2(Tasks: 28 successful, 28 total), thenpnpm --filter @object-ui/app-shell type-check: exit 0.tsc -p tsconfig.test.json --listFilesOnlylists all four touched test files.pnpm exec eslint --format jsonover the four files: 4 files, 0 errors, 0 warnings. This lint is narrowed: the four changed files are the whole population.eslint.config.jsenables no type-aware parsing, and nothing imports a test file, so no other file's verdict can move.pnpm lintis left to CI.check:control-bytes,check:test-path-roots,check:changeset-claims,check:pending-changeset-literals,check:new-line-citations,check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:phantom-deps,check:unreferenced-sources,check:metadata-write-doors,check:handler-key-reads,check-changeset-presence,check-changeset-no-major.Reverse checks. These ran once and were not committed. I used objectstack's
scripts/ablation-replace.mjsin WRAP mode onpackages/data-objectstack/src/metadata-client.ts, the one place that tells a/layers404 from a failure. Each restore was proven by a blob hash equal to HEAD and an emptygit diff HEAD.failure: absent).Acceptance notes
MetadataClient, the request is a PUT to the object with nomode=draft, and its body holds onlyfields.amount. The editor then shows "Saved.". I did not measure the real server's answer. This is reported to the seat and not pinned, so nothing here holds that body in place.readLayeredin the load. The read this remainder names (objectui#9420, other packages' rows) is the save's re-read. I measured both; the load's read is objectui#11928's and is unchanged.Session:
https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8Generated by Claude Code