Commit Graph

1 Commits

Author SHA1 Message Date
Hongming Wang
53e4ac329d feat(channel): surface 410 Gone with re-onboard hint instead of HTTP-410 (#2429)
Follow-up to molecule-core#2449 (which taught the platform to return
410 Gone for status='removed'). Without this branch the operator sees
`get_workspace_info failed: HTTP 410 — workspace removed` and has to
guess what to do — exactly the 2026-04-30 silent-fail UX hit on the
hongmingwang tenant.

The new code path:
  1. Detect resp.status === 410 explicitly
  2. Best-effort parse the body for id / removed_at / hint
  3. Throw `Workspace <id> was deleted on the platform at <ts>. <hint>`

The 410-message-formatting is extracted into a pure
`formatRemovedWorkspaceError` helper so it can be unit-tested
without mocking fetch + resolveWatching. Four new bun:test cases:

  - prefers platform-supplied id, removed_at, hint
  - falls back to local workspaceId + default hint when body is empty
  - tolerates null/undefined body (unparseable response)
  - omits ' at <ts>' clause when removed_at is missing

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 22:10:00 -07:00