Skip to content

social: a failed social/paused read is drawn as "not paused", so the paused-chat card silently vanishes or stays stale #3359

Backlog

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 6c31c09e3c674a7aabff89418745b042
Branch: dev/3-social-paused-read-error
Base: bab1fe9
At: 2026-11-24T08:20:39Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead
Bot: FlyBot Product

Written against live main bab1fe963b65913f5cd1021d30e6598a7f571627 (GitHub Date: Tue, 24 Nov 2026 08:05:02 GMT, re-read 08:10:43 GMT unchanged).

What is wrong today, in one user sentence: a friend chat whose paused-chat read fails is drawn as if the chat were not paused — the "Chat paused" card disappears with no line saying why, and a card already on screen keeps saying "Send your message again" from a read that no longer succeeds (#3323/#3325 fixed this same gap for the friends list).

Readings, all at bab1fe96 (Lead re-read the file on live main):

  • plugins/social/client.js:4013 — const [paused, setPaused] = useState(null)
  • plugins/social/client.js:4019 — call('social/paused', { handle }).then(value => { if (live) setPaused(value?.paused ?? null) }, () => {}) — the rejection branch is the empty function, so a failure writes nothing and nothing can tell "not paused" from "did not read".
  • plugins/social/client.js:4026 — if (!handle || !paused) return null — the card's absence is the same draw whether the answer was null or the read threw.
  • plugins/social/client.js:4030 — the only drawn answer: 'data-flybot': 'chat-paused', role: 'status'.
  • plugins/social/client.js:88-96 — errorText(e) already turns a failure into a usable sentence (NETWORK → Could not reach FlyBot. Check that it is still running.; social missing → Social is not running: the plugin did not start. See Settings → Feedback.), so this slice needs no new copy.
  • Same-file precedent, same family: plugins/social/client.js:3971-3973 — // A read that failed is not a read still on its way: the error row and its retry are the card's answer then, so the loading line must not stand there for ever (#3323). / const loading = friends === null && !listError.

Intent: no comment declares the swallow deliberate (:4008-4009 is the quiet-notice/owner 2026-10-19 decision, :4021-4022 is the #3315 ③ cadence; docs/subsystems/social.md:83/:128 describe the copy and the poll rule). The fix keeps the decision: quiet, no buttons, no Extend.

Red first

New file plugins/social/test/paused-chat-read-error.test.js, harness copied from plugins/social/test/poll-visibility.test.js:16-120 (hook runner + mount that runs effects + a call queue + a rerender() that reuses the hook table and does not re-run effects). Do not edit poll-visibility.test.js (open #3356 is adding to it). Each assertion, one expected value:

  1. queue [new Error('offline')], mount, settle, rerender() → nodes.filter(n => n.props?.['data-flybot'] === 'social-paused-error').length = 1 (today 0).
  2. same scene with code: 'NETWORK' → that row's own string children joined = 'Could not reach FlyBot. Check that it is still running.' (today the row does not exist, so undefined).
  3. queue [{ paused: { reason: 'loop detected' } }, new Error('offline')]: mount, settle, rerender() → 'chat-paused' = 1; then timers.tick(), settle, rerender() → 'chat-paused' = 0 (today 1, stale card) and 'social-paused-error' = 1.
  4. third answer { paused: { reason: 'loop detected' } } after another timers.tick() → 'chat-paused' = 1 and 'social-paused-error' = 0.
  5. in the state of 1 → nodes.filter(n => n.type === 'button' || n.type === 'input' || n.type === 'form').length = 0 (owner 2026-10-19; plugins/social/test/social.test.js:11591 already pins this for the card).

Fix shape (PausedChat only)

One more state slot for the failure; in load (:4018-4020) success sets paused and clears the failure, failure sets errorText(e) and leaves paused alone; in the draw if (!handle) return null, then when the failure is non-empty return one quiet line h('div', { className: 'fs-hold', 'data-flybot': 'social-paused-error', role: 'status' }, error) before the chat-paused branch. No button, no Extend, no turn count — the 5 s pollWhileVisible read is the retry.

Scope

May touch: plugins/social/client.js (:4010-4034 only) and the new test file.
Must not touch: plugins/social/test/poll-visibility.test.js (open #3356), plugins/social/src/social.js (its social/paused read is correct; the client drops the answer), core/src/client/** + core/client.js, patches/** (plugins/** is not patch-managed — patches/ds-bot/topics.json has no plugins/ entry), core/src/social/**.

Dedupe (open and closed, done by Lead)

repo:ThinkFlowLab/FlyBot social/paused → 67 hits, only open is #3354 (hidden-tab timers on the approval dock + friends panel — different surface); closed and unrelated #3327/#3328 (hidden-tab cadence), #3238/#3239/#3241 (zh copy), #440/#429/#413 (Extend removed). social-paused-error has 0 hits repo-wide (code search) and 0 issues.

Verify (repo root)

node --test plugins/social/test/paused-chat-read-error.test.js (red → green); node --test plugins/social/test/paused-chat-i18n.test.js (5 pass) and node --test plugins/social/test/poll-visibility.test.js (8 pass) unchanged — both green at bab1fe96; node scripts/i18n-usage.mjs check must stay 12 bare draws in 4 files, exit 0.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions