Repository navigation
test(gateway): table-drive device token lifecycle checks - #140403
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
5661abe to
08b272d
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:03 PM ET / 20:03 UTC. ClawSweeper reviewWhat this changesThe PR consolidates four device-token lifecycle tests into two rotate/revoke tables while preserving their setup, execution order, and assertions. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-requested cleanup preserves the tested behavior and remains distinct from the merged lifecycle repair. No actionable defects were found. Priority: P3 Review scores
Verification
How this fits togetherGateway device-token handlers process authorized rotation and revocation requests, invalidate affected connections, and cancel node wake work. These tests protect cancellation and the ordering of invalidation, replies, and disconnection. flowchart TD
A[Rotate or revoke request] --> B[Device token handler]
B --> C[Token mutation]
C --> D[Invalidate affected clients]
C --> E[Cancel node wake work]
D --> F[Reply to caller]
F --> G[Disconnect affected clients]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -35. Total -35 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the compact tables with method-specific fixtures and the existing cancellation and response-ordering assertions intact. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing regression tests and reports no new runtime defect. Is this the best way to solve the issue? Yes: the tables remove repeated setup while retaining separate execution for both methods and all existing ordering assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11f454ee82dc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…rol-ui * origin/main: docs: remove the empty release-sections nav group (#140427) fix(tooling): omit Codex machine squash credit (#140420) chore(ui): refresh control ui locales (#140384) refactor(plugin-sdk): reuse native approval input contracts (#140415) fix: silent model WebSocket streams hang past the idle timeout (#140335) perf(ai): avoid unused text extraction for image results (#140409) fix(ui): distinguish failed GitHub status checks from disconnected accounts (#140333) refactor(cron): share runtime feedback schema fields (#140408) fix: avoid duplicate cloud worker teardown during recovery (#140377) fix(cli): show executable approval scope (#138386) refactor(ui): reuse shared requirement records (#140407) test(gateway): table-drive device token lifecycle checks (#140403) fix(chat): fence delayed history at terminal retirement (#140379) test(skills): compare large upload bytes natively (#140402) refactor(delivery): reuse the canonical rendered batch plan type (#140386) docs(start): repair the first-run path from landing page to first channel (#140390) # Conflicts: # docs/.i18n/glossary.zh-CN.json
Related: #135868, #139421
What Problem This Solves
The pairing lifecycle suite repeats setup for token rotation and revocation around the same wake-cancellation and response-ordering boundaries. This is the maintainer-requested test compression pass in concern F of the #135868 split, following #139421.
Why This Change Was Made
Use two rotate/revoke tables while preserving all four cases in their original order. Each method keeps its own result fields, request parameters, caller permissions, and invalidation reason. The response callback still proves synchronous invalidation and defers disconnection until afterward.
User Impact
No runtime behavior changes. Tests shrink by 35 lines (+65/−100), from 838 to 803 lines; production, tooling, and docs each change by zero. No cases or assertions are removed.
Evidence
src/gateway/server-methods/devices.lifecycle.test.ts:509, “invalidates an in-flight node wake after device.token.rotate”:509, “invalidates an in-flight node wake after device.token.revoke”src/gateway/server-methods/devices.lifecycle.test.ts:558, “invalidates affected clients synchronously before responding to device.token.rotate”:558, “invalidates affected clients synchronously before responding to device.token.revoke”Seeded node teardown, caller-retirement and worker-cleanup failures, operator/node role distinctions, normalized identities, and same-device/cross-device response contracts remain separate and unchanged. The response-called assertion remains because it prevents the callback assertions from passing without a reply.
Full standard
src/gateway/server-methodsbaseline: 281 files, 5,428 passed / 2 skipped, 297.08 s. Full after-run: the identical 281 files and 5,428 passed / 2 skipped, 283.90 s. The complete before/after file sets match, including all 28 lifecycle cases. Fullnode scripts/check-changed.mjspassed, including test types, lint, guards, and all three dead-export scans. Independent Codex review is scoped-clean through P2;git diff --checkpassed. The rebase changed neither the lockfile nor the tested owners.Exact-head CI is green for
08b272dc9e2a567fb8f431701e42c3bf6ee26c0c: https://github.com/openclaw/openclaw/actions/runs/34056519770 . ClawSweeper reviewed the same head with no findings, before-merge requests, or rank-up moves.