Skip to content

social: a failed paused-chat read is drawn as an error row, not as not paused - #3364

Closed
HugoXK wants to merge 2 commits into
ThinkFlowLab:mainfrom
HugoXK:dev/3-social-paused-read-error
Closed

HugoXK wants to merge 2 commits into
ThinkFlowLab:mainfrom
HugoXK:dev/3-social-paused-read-error

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3359

Bot: FlyBot Dev-3
Owner: Dev-3
Written-by: Dev-3
Reviewer: Birfy

What was wrong

PausedChat (plugins/social/client.js:4010-4034 at base bab1fe963b65913f5cd1021d30e6598a7f571627) reads social/paused every 5 s, and its rejection branch was the empty function:

call('social/paused', { handle }).then(value => { if (live) setPaused(value?.paused ?? null) }, () => {})

A read that failed therefore wrote nothing, and the draw returned null for both answers:

if (!handle || !paused) return null

so "this chat is not paused" and "this read did not succeed" were the same picture: a paused card that was on screen silently vanished when the next read failed, and a card read before a failure stayed on screen with stale words (Send your message again: it starts a new chat) from a read that no longer succeeded. The friends list fixed exactly this gap in #3323/#3325; this is the card.

What changes

Only PausedChat:

  • one more state slot beside paused for the failure;
  • in load, success sets paused and clears the failure, failure sets errorText(e) and leaves paused alone, so a failed read never invents "not paused";
  • in the draw: if (!handle) return null, then a non-empty failure returns one quiet status row data-flybot="social-paused-error" (role: 'status', class fs-hold), then the chat-paused branch as before;
  • no new copy (errorText() at :88-96 already turns NETWORK into Could not reach FlyBot. Check that it is still running.), no button, no input, no Extend, no turn count (owner 2026-10-19) — the 5 s pollWhileVisible read is the retry, so the row disappears on the next read that succeeds.

Red first

New file plugins/social/test/paused-chat-read-error.test.js (harness from poll-visibility.test.js:16-120: hook runner, mount that runs effects, queued call answers, rerender() that reuses the hook table and does not re-run effects). On the test-only commit 1da5e3aeb4acf1828f112150a176209a7c4ec941 (tree a5f55e894a43a6ea3b7e064f680a229549410c3e, base bab1fe963b65913f5cd1021d30e6598a7f571627), same command twice:

cd plugins/social && node --import ./test/resolve.mjs --test test/paused-chat-read-error.test.js

Both runs # tests 5 | # pass 1 | # fail 4, identical:

  1. not ok 1 - a paused-chat read that fails writes one quiet error row — expected: 1 / actual: 0, :158 (the row does not exist today).
  2. not ok 2 - a NETWORK failure names the reason the users can act on — expected: 'Could not reach FlyBot. Check that it is still running.' / actual: '', :169.
  3. not ok 3 - a card read before the failure is dropped when the next read fails — expected: 0 / actual: 1, :184 (the stale card stays). The first assertion of the same test, :180, is the green control: the first answer does draw the card.
  4. not ok 4 - the next read that succeeds clears the error and draws the card again — expected: 1 / actual: 0, :200 (in the base the sequence starts from the swallow of ①, so the card never comes back); :196 and :201 follow it.
  5. ok 5 - the failed read draws no button, input or form — the green control on the base: the quiet notice stays quiet (owner 2026-10-19).

Each assertion has exactly one expected value; ⑤ is green at the base by design, so the red is 4 real failures, not 5.

Ran / Not run

  • ran test/paused-chat-read-error.test.js → 5/5, 0 fail.
  • ran test/paused-chat-i18n.test.js → 5/5 (unchanged).
  • ran test/poll-visibility.test.js → 8/8 (unchanged; not edited — open #3356 owns it).
  • ran npm --prefix plugins/social test → 785/785, 0 fail, rc 0 (baseline on this base: 780 + the 5 new).
  • ran node scripts/i18n-usage.mjs check → 12 bare draws in 4 files, rc 0 — unchanged; no new bare draw.
  • ran ARCH_DOCS_BASE=bab1fe963b65913f5cd1021d30e6598a7f571627 node core/scripts/check-arch-docs.mjs → arch-docs: OK (2 changed file(s)); the fix commit carries the required Docs-not-needed: trailer (the card's own copy is unchanged).
  • not run npm run verify as one command: the other plugin suites and the interop stages are outside this change; each stage this change touches is listed above.

No changelog fragment and no docs line: the issue scopes the diff to plugins/social/client.js:4010-4034 plus the new test file, and no copy is added — the row reuses errorText(), the same sentence the friends list already shows (#3323).

Screenshots

Both rendered from the real client module in Chromium (DOM captured, not a mock): the card is on screen from a successful read, then the next 5 s read fails — the exact sequence of case ③.

  • before (bab1fe963b65913f5cd1021d30e6598a7f571627): before — 460×78 CSS px, the stale card stays: Chat paused / Bot Social paused the last chat with this Bot (loop detected). Send your message again: it starts a new chat.
  • after (dd6a8ea2f091c509a2d928eae90be67ddc4079ab): after — 460×41 CSS px, the card is gone and one quiet line says why: Could not reach FlyBot. Check that it is still running.

Evidence branch evidence/3359 carries the two PNGs only (no code, no PR); the raw links are pinned to 33f58d1f11359999a2ea41c82212c1d048858de4, so a later rewrite of that branch cannot change what this body shows.

Verification at tip dd6a8ea2f091c509a2d928eae90be67ddc4079ab

  • tip dd6a8ea2f091c509a2d928eae90be67ddc4079ab, tree 7c130f8c7e5658f64318374535d32284df2fc675, base bab1fe963b65913f5cd1021d30e6598a7f571627
  • 2 files, +230/−2: plugins/social/client.js +14/−2, plugins/social/test/paused-chat-read-error.test.js +216/−0 (new)
  • no other file touched: no poll-visibility.test.js, no plugins/social/src/social.js, no core/src/client/**, no core/client.js, no patches/**

Checkpoint

{
  "pr": 3364,
  "claim": "Dev-3",
  "issue": 3359,
  "summary": "The paused-chat card reads `social/paused` every 5 s; its rejection branch was an empty function, so a read that failed wrote nothing and was drawn exactly like "this chat is not paused" — the card vanished when it had been there, and a card read before a failure stayed on screen with stale words. The read now keeps one failure state beside `paused`: success sets the card and clears the error, a failure sets `errorText(e)` and leaves `paused` alone, and the draw shows one quiet `social-paused-error` line before the card branch (no button, no Extend — the 5 s poll is the retry). The friends-list error surface (#3323/#3325) is the precedent.",
  "files": [
    "plugins/social/client.js",
    "plugins/social/test/paused-chat-read-error.test.js"
  ],
  "checks": {
    "ran": "npm --prefix plugins/social test",
    "result": "green",
    "at": "dd6a8ea2f091c509a2d928eae90be67ddc4079ab"
  },
  "next": "none — ready for review"
}

…Lab#3359)

The paused-chat card's `social/paused` read swallowed its rejection, so a read
that failed was drawn exactly like "this chat is not paused": the card vanished,
and a card read before the failure stayed on screen with stale words. The
failure now has its own state and is drawn as one quiet status line; a later
success replaces it. The 5 s poll is the retry, and the card still has no button.

Docs-not-needed: the card's own copy is unchanged; a failed read shows the
existing `errorText()` sentence in a quiet status row, and the issue scopes the
diff to `plugins/social/client.js:4010-4034` plus the new test file.
@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — verdict request for this tip, once: dd6a8ea2f091c509a2d928eae90be67ddc4079ab.

Fixes #3359, base bab1fe963b65913f5cd1021d30e6598a7f571627 (= live main), 2 files +230/−2, maintainer_can_modify: true, non-draft.

At that exact tip: 18 checks = 14 success + 1 cancelled (agent-audience) + 2 skipped (live · real model, window check) + 1 failure — the only red is enqueue-guard (no Verifier report names the tip dd6a8ea2), which is what this request exists to clear. Green: tests-ok, merge-gate, judge, package, plugins (social|timeline|tree|workflow), mock, ubuntu leg, policy-sign, reviewed tip, risk tier.

What the change is, in one line: PausedChat (plugins/social/client.js:4010-4034) used to draw the same null for "not paused" and "the read failed"; a failure now sets one quiet role="status" row data-flybot="social-paused-error" built from the existing errorText() (:88-96), so a stale chat-paused card cannot outlive the read that drew it — no new copy, no button, no Extend (owner 2026-10-19 decision kept).

Red-first evidence in the body: the new plugins/social/test/paused-chat-read-error.test.js is 5 tests / 1 pass / 4 fail twice on the base source, then green at the tip; plugins/social suite green; i18n-usage check unchanged at 12 bare draws in 4 files. plugins/social/test/poll-visibility.test.js (owned by open #3356) was not edited.

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy: review request for #3364 at tip dd6a8ea (base bab1fe9)

@github-actions github-actions Bot added the risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff label Nov 24, 2026
@HugoXK

HugoXK commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Repackaged for FlyBot 2.0 / OpenTeamily in #3382 — same behaviour, reimplemented against the 2.0 tree (runtime/flybot/plugins/social/client.js, the vendored 2026-11-16 snapshot; the old diff does not apply because 2.0 predates the pollWhileVisible helper). Recorded in docs/upstream/migration-manifest.json → modified_files. This PR stays open as the v1.0 record; nothing was closed, merged or retargeted.

Ported part: a failed social/paused read now draws social-paused-error instead of "not paused", and the 5 s read remains the retry.

Repo-wide evidence: FLYBOT_2.0_PR_AUDIT_RESULT.md (2026-11-25).

@Birfy

Birfy commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

按旧布局退役关闭。

本 PR 改的是 plugins/social/client.js,该路径在当前 main 1ae1e658(2026-11-25T14:41:26Z)上不存在(git cat-file -e 1ae1e658:plugins/social/client.js → ABSENT;0.3.0 之后社交插件在 runtime/flybot/plugins/social/client.js,EXISTS)。

同一批修正在新布局上已有一份移植版 #3382(改 runtime/flybot/plugins/social/client.js,并新增 runtime/flybot/plugins/social/test/paused-chat-read-error.test.js),不再保留两份。

Related #3359 Refs #3382

@Birfy Birfy closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants