Skip to content

social: a failed Auto-send settings read is drawn as the setting being off, and the switch stays live #3367

Backlog

Description

@HugoXK

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

Written-by: Dev-3
Claimed-by: Dev-3
Claim-Id: 7aeea16e686f47ef8a3ff1c53d1b59c7
Branch: dev/3-friend-auto-read-error
Base: bab1fe9
At: 2026-11-24T09:20:29Z

A friend Bot's settings card (FriendChatSettings) reads the pair's Auto-send setting once, on mount. Its rejection branch is the empty function, so a read that failed leaves the checkbox at its initial false — drawn exactly like a setting that is off — and the switch stays live. The person then reads "my Bots' replies to this friend go out without asking" as the state they chose, which is the opposite of what the stored setting may be.

Readings at base bab1fe963b65913f5cd1021d30e6598a7f571627, all in plugins/social/client.js:

  • :3762 — const [auto, setAuto] = useState(false): the state has two values, so "nobody read it yet" has no representation.
  • :3769 — call('social/settings', {}).then(value => setAuto(value?.autoAccept?.[home] === true), () => {}) — the rejection branch writes nothing, so a failure is indistinguishable from an answer of false.
  • :3827 — disabled: saving || !home — the switch is offered although no read answered.
  • :3822-3829 — the box draws the checkbox and one hint; no line can say the read failed.
  • :88-96 — errorText(e) already turns a failure into a usable sentence (NETWORK → Could not reach FlyBot. Check that it is still running.), so no new copy is needed.
  • Same family, same fix shape already merged: #3323/#3325 (friends list error row), #3359 (paused-chat card).

Intent: no comment declares the swallow deliberate. The fix keeps the card quiet: one status row, no new button, and a remount (reopen the card) retries.

Red first

New file plugins/social/test/friend-auto-read-error.test.js (harness from poll-visibility.test.js:16-120). Each assertion, one expected value:

  1. social/settings rejects (new Error('offline')) → an error row data-flybot="friend-auto-read-error" count = 1 (today 0).
  2. the same read with code: 'NETWORK' → that row's text = Could not reach FlyBot. Check that it is still running. (today the row does not exist, so '').
  3. after that failure the checkbox is disabled: true (today false), because a value nobody read is not a value to flip.
  4. control: a read that answers { autoAccept: { '@eve.home': true } } → checkbox checked: true and no error row.
  5. control: a read that answers false → checkbox checked: false and no error row.

Fix shape (FriendChatSettings only)

auto becomes tri-state (null = not read yet); one more state for the failure; the effect keeps a live flag, success sets the value and clears the failure, failure sets errorText(e) and leaves the value unknown; the checkbox is disabled while the value is unknown and the box draws one quiet friend-auto-read-error status row. No new copy, no new buttons.

Scope

May touch: plugins/social/client.js (FriendChatSettings only, :3758-3850) and the new test file, plus one changelog.d/ fragment.
Must not touch: plugins/social/test/poll-visibility.test.js (#3356), plugins/social/test/paused-chat-read-error.test.js and plugins/social/client.js:4010-4034 (#3364), plugins/social/client.js:2592 (#3356), plugins/social/src/social.js, core/client.js, patches/**.

Dedupe (open and closed)

repo:ThinkFlowLab/FlyBot "FriendChatSettings" → 10 hits, all closed and unrelated (#3225/#3223 zh copy, #1001/#1033 removal line, #2219 read-only window). "auto-send" → 150 hits, none about a failed settings read (#417 was the hidden home-wide value, closed). "social/settings" → 106 hits, none about the rejection branch. friend-auto-read-error → 0 hits repo-wide.

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