Skip to content

Bug: A failed sharing-status read labels an active chat link Keep private and prevents revocation #3717

Closed

Description

@yannickmonney

A settled sharing-status failure falsely presents a shared chat as private. Clicking Keep private sends no revoke request, and the existing organization snapshot remains readable. Suggested severity: P2. This does not make the link public or bypass organization membership.

Reproduce on a local instance:

  1. Create an ordinary chat and share its snapshot with the organization. Verify share-status says isShared: true and the authenticated shared snapshot returns 200.
  2. Open the actual Share chat dialog with no cached status for that thread. Make its GET share-status request fail with 503 through all query retries.
  3. Wait until the query is in error with fetchStatus: idle, then inspect the picker and click Keep private.
  4. Independently read the native status and snapshot, outside the failed UI transport.

Expected: An unavailable sharing state is explicitly unknown, with visible failure and recovery. The dialog must not assert privacy or imply that an action revoked a link when it did not.

Observed: Keep private is checked and enabled; the link and any error/retry are absent. Clicking it sends no POST. Native state remains isShared: true and the snapshot still returns 200. The successful-read control selects Share with organization, sends the actual unshare request on Keep private, persists isShared: false, and makes the snapshot return 404.

Root: share-chat-dialog.tsx maps every non-ready status to undefined, derives isShared=false, and treats only loading as disabled. handleAccessMode exits because the requested private mode is already selected. The documented Stop sharing contract says Keep private makes the link unavailable.

Recovery recommendation: preserve explicit loading/error/ready states, show an actionable read failure, and permit privacy decisions only against known state. Add a settled-failure regression with native shared-state readback. This is separate from #2086's arena/shareability guard.

Executed proof: chat-sharing-wave01/share-state.probe.test.tsx, vitest.config.ts, and share-state-run4.log under /Users/yannick/.codex/notes/tale-1000-additional/. Five observation/control cases passed. The actual ShareChatDialog, feature hooks, query adapter, shared components and clipboard interaction run in jsdom against fresh native localhost thread/share fixtures. Each case owns a distinct thread to exclude the hook's module cache. The controlled fetch dispatcher admits only the local chat routes; no messages or provider calls are made. The component fixture stubs navigation, so its router/act warnings are not product findings.

Replay from the pinned audit worktree with its installed dependencies and retained local stack:

bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-1000-additional/chat-sharing-wave01/vitest.config.ts

The failed response is deliberately injected at the last HTTP boundary; native creation, share, unshare and snapshot reads execute against the local database. A real local Chrome check verified the normal sharing/revocation controls, not the injected failure.

Verified locally at 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d. The relevant implementation is unchanged in fetched main d351611bd. Production was used only for task-board coordination. Deduplication covered all 1,035 all-state issue bodies in the live batch-02 snapshot, the original 102-report baseline and the new finding ledger. One distinct cause is counted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions