Skip to content

Omit a null hostId from thread tabs responses so older mobile builds still sync - #2144

Merged
SawyerHood merged 1 commit into
mainfrom
bb/fix-inaccessible-mobile-images-thr_fs3nw3qdvi
Aug 21, 2026
Merged

Omit a null hostId from thread tabs responses so older mobile builds still sync#2144
SawyerHood merged 1 commit into
mainfrom
bb/fix-inaccessible-mobile-images-thr_fs3nw3qdvi

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

What was wrong

Image links in the mobile app failed with a "Couldn't sync tabs" toast. The links and the image routes were fine. A tap opens a host-file-preview panel tab, and the app then syncs the tab strip with GET/PUT /threads/:id/tabs. #2005 added hostId to host-file-preview tabs with .default(null), so the server now emits hostId: null in every tabs response. Installed mobile builds bundle a .strict() copy of threadTabsResponseSchema that predates the field, so their SDK rejects the whole response (Unrecognized key: hostId), the mutation errors, and the tab never settles. Phones cannot update in step with the server, so the server must stay readable by the shipped schema.

What changed

  • apps/server/src/routes/threads/tabs.ts: the GET and PUT responses omit hostId when it is null, on host-file-preview tabs and on host-file-preview file-opener owners of plugin-panel tabs. A non-null hostId still travels. Current clients parse the omission back to null through the schema default.
  • packages/server-contract: added ThreadTabsWireResponse (z.input of the response schema) and typed both tabs routes with it.

No daemon wire change, so no HOST_DAEMON_PROTOCOL_VERSION bump.

How you verified

  • New test in apps/server/test/public/public-thread-tabs.test.ts that fails before the route change (expected … to not have property "hostId") and passes after it.
  • pnpm exec turbo run test --filter=@bb/server -- test/public/public-thread-tabs.test.ts: 3/3 pass. @bb/server-contract tests: 58/58 pass.
  • pnpm exec turbo run typecheck for @bb/server, @bb/sdk, @bb/app, @bb/mobile, @bb/demo-server: pass.
  • Manual: paired the iOS simulator with the live bee.getbb.app server on a current Metro bundle; storage and host-file image links open the panel tab and the lightbox.

Fixes #

AGENT GENERATED: by Claude Opus 5

…still sync

Installed mobile builds parse the tabs routes with a strict copy of the
contract that predates hostId. The server now emits hostId: null, so
those builds reject every response and show "Couldn't sync tabs" when a
host-file link opens a panel tab. Omit the field when it is null; current
clients default it back.

Co-Authored-By: Claude <noreply@anthropic.com>
@SawyerHood
SawyerHood merged commit 2c0b747 into main Aug 21, 2026
13 checks passed
@SawyerHood
SawyerHood deleted the bb/fix-inaccessible-mobile-images-thr_fs3nw3qdvi branch August 21, 2026 04:32
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.

1 participant