Skip to content

FlyBot 2.0 / OpenTeamily — social: hidden-window polls and read-error states - #3382

Open
HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:v2/repack-social-ui-20261125
Open

HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:v2/repack-social-ui-20261125

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

FlyBot 2.0 / OpenTeamily — social: hidden-window polls and read-error states

Repackages the intent of #3356, #3364 and #3370 (all three originals stay open).

Related #3356
Related #3364
Related #3370

Problem

The vendored social plugin at runtime/flybot/plugins/social/client.js (blob df78f717, the 2026-11-16 snapshot) still runs the polls and read paths it had inside FlyBot 1.x, where three defects were found and fixed in PRs that never landed on this tree:

What now really works

  • A hidden tab makes no poll read and holds no timer, in the chat approval dock (5 s) and in the friends/requests panel (15 s). A tab that comes back reads once at once and the cadence restarts from that read; unmount removes the listener.
  • A paused-chat read that fails draws one quiet status row and drops the stale card; the 5 s read is the retry, with no button.
  • A friend settings card whose Auto-send read fails draws one quiet status row and withholds the checkbox until a value is known; a read that answers draws the same switch it did before.

What changed

  • runtime/flybot/plugins/social/client.js: adds pollWhileVisible(fn, ms) (no timer while document.hidden, one read when the tab returns, cadence restarting from that read, returns stop()) and routes the dock's 5 s and the panel's 15 s poll through it; adds an error state to PausedChat with data-flybot="social-paused-error"; makes FriendChatSettings hold auto === null until a read answers, adds a friend-auto-read-error row, and disables the checkbox while the value is unknown.
  • Three new test files plus a shared bench: test/poll-visibility.test.js, test/paused-chat-read-error.test.js, test/friend-auto-read-error.test.js, test/client-harness.mjs.
  • Provenance: plugins/social/client.js moves out of docs/upstream/flybot-files.json (identical) into docs/upstream/migration-manifest.json → modified_files, with its original and new hashes, and the four added test files are recorded there too; the flybot file_count drops 46 → 45.

Unchanged by design

The visible cadence (5 s / 15 s), every sentence already on screen, the social/status, social/paused and social/settings endpoints, the plugin's host surface, and the server-config path are untouched. src/social.js and src/server-config.js are untouched.

Intentionally not in this PR

Proof

  • Branch v2/repack-social-ui-20261125 at 42851df3be4e2e887e3af341eb25eaf85e8f5eb4; base is upstream main at push time (be7b1dac, the Add a FlyBot feature demo to the README #3380 merge), so the merged README demo is preserved. The push tool writes changed blobs, so the change is one commit on top of the vendored tree rather than the three local commits it was built from.
  • Local commands and counts (Node v22.23.2, TMPDIR on a writable directory — the credentials tests mkdtemp under it, and a read-only TMPDIR fails 34 of them with EROFS):
    • cd runtime/flybot/plugins/social && npm test (node --import ./test/resolve.mjs --test "test/*.test.js") → 178 tests, 178 pass, 0 fail.
    • Same command at the pristine import (git worktree at the root commit 5e78a30, i.e. upstream 6be84f48): 165 tests, 165 pass, 0 fail — so this branch adds 13 tests and 13 passes and changes no existing result.
    • The three new files alone: node --test test/poll-visibility.test.js test/paused-chat-read-error.test.js test/friend-auto-read-error.test.js → 13 tests, 13 pass.
    • Red first, same 13 against the pristine client.js: 9 fail, 4 pass (the 4 pin behaviour that already worked: on/off drawing, no buttons on an unmounted read, unmount cleanup).
    • python3 scripts/verify-upstream-migration.py → verify-upstream-migration: ok (flybot 45 files, bot-social 437 files).
    • python3 -m unittest discover -s tests -p 'test_upstream_migration.py' → 7 tests, OK.
  • Required checks at this head: reported on the PR; the local suite and both provenance commands are green as listed below. client.js is executed by provenance / flybot-social-plugin-tests; the social-host jobs import index.js / src/social.js and not client.js.
  • CLEAN / conflicts / unresolved discussions: branch built on the current upstream import; no conflicts.
  • Screenshots: none — behaviour only. On a working server every screen looks and reads the same; the new rows need a failing read to appear, and no 2.0 runtime was started in this workspace.
  • Known blockers: none locally.

Overlap check

Read the three open originals (#3356, #3364, #3370) and their diffs: they are written against our 1.x plugins/social/client.js (89592f6a) and do not apply here (poll-visibility.test.js does not exist in 2.0, and the hunks collide at client.js:4011 / :3813). This branch reimplements the same behaviour at the 2.0 paths; no other open pull request touches runtime/flybot/plugins/social/client.js or docs/upstream/migration-manifest.json.

Deployment / rollout

none

Not claimed

No vendor/container/browser acceptance and no parity claim. The behaviour, not the hunk, was ported; the branch is one commit because the push tool replays blobs.

Written-by: Dev-2
Bot: FlyBot Dev-2

The friend settings card read the pair's Auto-send setting with an empty rejection
branch: a failed read left the checkbox at its initial false, drawn exactly like a
setting that is off, while the switch stayed live — the person could read the
setting as one they chose.

The value is now unknown (null) until a read answers, the failed read draws one
quiet status row, and the switch is withheld while unknown. Provenance: the vendored
plugins/social/client.js moves from the identical list to modified_files, and the
four added test files are recorded with it. Ports the intent of ThinkFlowLab#3370 (stays open).
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