Skip to content

fix(platform): correlate device setup with its join command - #4257

Merged
yannickmonney merged 1 commit into
mainfrom
fix/correlate-device-enrollment
Oct 4, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/correlate-device-enrollment

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

  • Return the join grant's non-secret ID with the one-time command.
  • Add GET /api/app/sandbox-devices/join-tokens/:tokenId, guarded by the
    existing admin ability and scoped in SQL to the authenticated organization
    and the administrator who minted the grant. It returns only deviceId
    (null until used), with Cache-Control: no-store; inaccessible grants return
    the same 404 as missing grants. No plaintext token or hash is read back.
  • Poll that grant while Add device is open. Only its enrolled device, present
    in the current list and no longer offline, can complete this dialog. Separate
    commands from the same administrator also stay separate. Remount on org changes.
  • Preserve inline generation retry and a fresh command per opening. Add focused
    component/service/route/adapter regressions and manual box SET-B31.

Verification

  • Reproduced on origin/main at d29a3c8fe: the new component regression fails
    because A confirms “Other administrator laptop is connected.” (12 controls pass).
  • Focused Vitest runs with the installed Node runner and --maxWorkers=1:
    • device section and Sandboxes settings components: 34 passed;
    • device service/routes and settings/backend adapters: 80 passed;
    • adjacent device settings/ticket and command tests: 7 passed;
    • backend query hook tests: 19 passed;
    • failure-message and single-toast guards: 75 passed.
  • Changed-file oxlint (including type-aware), oxfmt and git diff --check: passed.
  • Scoped TypeScript check (changed TS/TSX files plus required declarations and
    their imports, bounded 2.8 GiB heap): passed; no whole-workspace tsc.
  • Opengrep over changed files: 0 findings. Manual layout gate and settings
    guide-reference checker: passed.
  • Accessibility and EN/DE/FR sweep: no markup, accessible names or strings change;
    the existing status announcement and inline retry remain. Existing device docs
    describe the intended behavior now restored; no docs or migration needed.

Limits

No browser, E2E, full stack or full suite was run locally. The issue's frozen
macOS/PostgreSQL proof is not available in this sandbox and was not claimed as
rerun; backend unit tests capture the parameterized, creator/org-scoped SQL.
The new manual box is authored, not marked executed. Independent review and
exact-head CI remain required before merge. No CI rerun or cancellation.

Closes #3681

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review record for exact head fc6cef96c848c908cdf1a9f678917b7a57a06c51: accept; no blocking findings.

Evidence reviewed:

  • AddDeviceBody polls the exact minted token and only completes when that token's device is present and non-offline; another administrator's enrollment, already-present devices, and new offline devices remain waiting.
  • Mint failure renders an inline retry.
  • The new read is admin-only, no-store, organization-scoped, creator-scoped, and returns the same 404 for missing/inaccessible grants.
  • Component, adapter, route, and service tests cover these controls.

Unrun proof: I did not rerun the frozen main regression, browser/full-stack proof, PostgreSQL proof, full platform suite, CI, or CI watch. The selected local run passed settings-sandbox.test.ts (12 tests); the other selected suites were blocked by this environment's dependency/config resolution (z.number undefined and Storybook file: preset resolution). No merge or push performed.

GitHub's native approval endpoint rejected this review because the repository token shares the PR author's GitHub principal (Review Can not approve your own pull request); this comment is the acceptance record requested by the independent-review task.

@yannickmonney
yannickmonney merged commit 2d27d31 into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/correlate-device-enrollment branch October 4, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(platform): add device confirms another administrator’s device while its own command is unused

1 participant