Repository navigation
fix(app-shell): the record page reads the lock service's 501 silently and asks no more - #26841
Merged
Merged
Conversation
… and asks no more Claude-Session: https://claude.ai/code/session_01J8VVAojjEQUUoMeSBSdgW4 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8VVAojjEQUUoMeSBSdgW4 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8VVAojjEQUUoMeSBSdgW4 Co-authored-by: Claude <noreply@anthropic.com>
…efore Claude-Session: https://claude.ai/code/session_01J8VVAojjEQUUoMeSBSdgW4 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
CI red on head All three failing checks fail in files this PR does not touch (its diff is
Plan: once #26849 lands on main, the branch takes one merge of Generated by Claude Code |
Contributor
Author
维护者速读 · 席位定稿
席位核对
Pointer on the card: ACCEPT → this comment. Generated by Claude Code |
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.
Requested by Irene · project thread
Fixes #26632
Clause-②: no
Metadata-protocol: none
维护者速读
HTTP request failed ... -> 501,而 501 正是设计中的「没有锁服务」。ui/packages/app-shell/src/hooks/useRecordApprovals.ts的readRecordLock与startRead里的读锁分支;RecordDetailView.approvalLock-25934.test.tsx新增两条用例。cd ui && pnpm exec vitest run packages/app-shell/src/views/RecordDetailView.approvalLock-25934.test.tsx,预期 6/6 通过。What changes
useRecordApprovalsasksGET /approvals/records/OBJECT/ID/lockwhen the approvals list finds no pending request (#25934). It used to read it throughclient.approvals.getRecordLock. The SDK client logs every non-2xx withlogger.error('HTTP request failed', …)before its caller sees the answer, and the console's client logger (createQuietHttpLoggerin@object-ui/data-objectstack) prints that withconsole.error. So on a composition without the approvals service, whose designed answer to that read is501 NOT_IMPLEMENTED, every record open printed a red line, although the hook already treated the 501 as "not locked".Measured producer:
packages/client/src/index.tsfetch()(the unconditionallogger.erroron!res.ok) →ui/packages/data-objectstack/src/index.tscreateQuietHttpLogger().error→console.error. The PM hypothesis held. The fix lands in app-shell, the expected file surface, so@objectstack/clientis not changed.fetchJson, the same transport the approvals list read beside it already uses. That transport logs nothing. The{ success, data }envelope is unwrapped as the SDK did.recordLockAbsent): no record asks again until the page reloads.__resetRecordApprovalsStoreclears it.createQuietHttpLoggerthe SDK client would have used:HTTP request failed: GET URL -> STATUS [CODE], a 404 still demoted to debug. The next open asks again.RecordDetailView.recordOpenWaves-13010caught the lock read appearing as a second wave on its adapter-less page. The gate is kept.Why
The triage ruling on the card (6441358448): the record page treats a 501 from the lock read as "no lock service", silent, no retry; any other failure still logs.
Tests
RecordDetailView.approvalLock-25934.test.tsxnow stubs the lock route on the global fetch rather than the adapter's SDK method, and pins that the SDK method is never called.console.errorline naming the lock path, and a second open of the record reads the list again but not the lock.GET … -> 500), and the next open asks again.scripts/ablation-replace.mjs, restore verified by blob hash), the new 501 test went red on theHTTP request failed: GET /api/v1/approvals/records/account/acc_northwind/lock -> 501 [NOT_IMPLEMENTED]line, 1 failed / 5 passed.Acceptance notes
200 { data: [] }when the service is missing while the lock door answers 501. Removing that last line needs the two server doors to agree, which isdomain:serverwork (packages/rest/src/approvals-routes.ts) and outside this card. Noted, not filed.X-Environment-IdandAccept-Languageheaders. The approvals list read beside it never did, and the console's adapter sets no environment id.Verification
All on head a0185cf, in a shared container (seconds are shared-box seconds).
cd ui && pnpm exec vitest run packages/app-shell/src/hooks/useRecordApprovals packages/app-shell/src/hooks/__tests__/useRecordApprovals packages/app-shell/src/views/RecordDetailView.recordOpenWaves-13010.test.tsx packages/app-shell/src/views/RecordDetailView.approvalLock packages/app-shell/src/views/RecordApprovalsPanel: Test Files 15 passed (15), Tests 107 passed (107).pnpm --filter @object-ui/app-shell run type-check: exit 0.node scripts/pm/dispatch-gates.mjs --commands: 34 derived commands, each run locally with exit 0,pnpm check:type-check-debtincluded (re-run under the verify lock after its first run could not get the lock).node scripts/check-sdui-manifest.mjsexit 0.Test UIruns it.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (No formatter ran. Lint is left to CI.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code