Skip to content

Show a friend's first line and its approval card live: read friends' inboxes fast while a window is on screen - #505

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:fix/497-live-friend-line
Oct 20, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:fix/497-live-friend-line

Conversation

@Birfy

@Birfy Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes #497

Root cause. Nothing on FlyBot's live path regressed since #432. On a two-home bench at main a7adfe0 (local Bot Social + mock model, browser on A's Chief chat), B's first line, the held reply's Waiting for approval card, the Inbox count and the badge all show without a reload. They just show late: the social plugin reads a Bot's Bot Social inbox only on its idle timer (inboxPollMs, 15 s), and the card also waits for the model's reply. #432 never fixed acceptance item 1; its PR said it found no cause and pointed at the 15 s poll. The self-test logs match: B sent at 12:39:26, A delivered at 12:39:34 (+8.5 s), and the card arrived at 12:39:41 (+15 s). Someone watching for about 8 s sees nothing and then reloads.

What changes

  • Client (index.js): the roster poll sends watching: !document.hidden with each state call.
  • Host (channel.js, hooks.js): state notes when a window on screen last read the team. A hidden window does not count; an older client that sends nothing does. That is rt.watched() (8 s), offered to plugins as flybot.watched(). Process-local, nothing saved.
  • Social (social.js): while a window watches, a second timer reads the inbox at the live cadence (facePollMs, 4 s). It skips ticks the shared timer already covers (a live face room) and ticks within half a period of the last read. With no window open nothing changes (15 s).
  • Docs: core-host, core-client, plugin-runtime, social. Changelog fragment.

Measured on the two-home bench (B sends, until the line is in A's open Chief chat, 5 lines each): main 7.7–12.5 s, this branch 1.3–3.1 s. The card and the Inbox count follow on the same host revision, after the mock model's reply.

Tests

Ran: ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify at the tip, passes (arch-docs OK; plugin lint OK; core 1079, social 297, tree 80, timeline 83, scripts 93, interop 37, live-e2e 16; 0 failures). Two-home live bench (local Bot Social at 6a97ba0, mock model, headless and headful Chrome) before and after.
Not run: prod Bot Social, real model, the Mac instances, the Desktop app, smoke bench.

Risk tier: T2 (estimate; the controller sets the label)

… screen (ThinkFlowLab#497)

A friend's first line, its held reply's approval card, the Inbox count and
the unread badge reached an open window only on the social plugin's next idle
inbox poll (up to 15 s, plus the model's reply time), which read as 'needs a
reload'. The client now says when it is on screen (state watching), the host
exposes flybot.watched(), and social reads the inbox every facePollMs (4 s)
while a window watches. Regression tests for the live first line + approval.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 20, 2026
@Birfy Birfy self-assigned this Oct 20, 2026
@Birfy Birfy added bug Something isn't working area:social Friends, invites, grants, Bot Social area:ui Web/desktop UI and copy self-test Filed by the product self-test routine (issues only) labels Oct 20, 2026
@Birfy

Birfy commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review: PASS
Tip SHA: afebea7
Ran:

  • ARCH_DOCS_BASE=origin/main TZ=UTC npm run verify at the tip: pass (arch-docs OK, 17 changed files; plugin lint OK; core 1079, social 297, tree 80, timeline 83, scripts 93, interop 37, live-e2e 16; 0 failures)
  • node scripts/ds-bot-patches.mjs generate + check: ok; build-client.mjs --check: ok
  • New Friend's first line and its approval card don't arrive live on the sharing home; need a reload (regression of #420) #497 tests (core flybot.test.js, social.test.js): pass on the branch; the flybot.watched test and the social live-cadence test fail on main
  • Two-home live bench (local Bot Social at 6a97ba0, mock model, Chrome on A's open Chief chat): B's line visible on A after 7.7–12.5 s on main vs 1.3–3.1 s on this branch (5 lines each); the approval card and the Inbox count arrive live on both, with no reload
  • CI at the tip: tests-ok green (test, plugins social/tree/timeline, package)
  • Diff checked against the owner design rules: no grant, publish, approval or connector change; the approval stays on its UI buttons; no new UI copy; no Bot Social server change
    Not run:
  • Prod Bot Social with a real model, the owner's Mac instances, the Desktop app, smoke bench

@Birfy Birfy added the awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip label Oct 20, 2026
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Oct 20, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 20, 2026
Merged via the queue into ThinkFlowLab:main with commit 303c0d6 Oct 20, 2026
8 checks passed
@Birfy
Birfy deleted the fix/497-live-friend-line branch October 20, 2026 06:52
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
…ThinkFlowLab#481/ThinkFlowLab#501/ThinkFlowLab#505)

Keep ThinkFlowLab#499 composer-label / data-placeholder docs with ThinkFlowLab#481 phone hold-card targets.
Regenerated client bundle patch after merge.
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
…owLab#481/ThinkFlowLab#501/ThinkFlowLab#505)

Regenerated client bundle patch after merge; auto-merged social sources keep ThinkFlowLab#498 friend Bot name formatter with ThinkFlowLab#501/ThinkFlowLab#505.
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
Birfy added a commit to Birfy/FlyBot that referenced this pull request Oct 20, 2026
@Birfy Birfy removed the awaiting-approval PR is green and waits for the maintainer's approval (T2/T3) or a review PASS at its tip label Oct 21, 2026
@Birfy Birfy removed the agent-pr Pull request opened by an agent label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:social Friends, invites, grants, Bot Social area:ui Web/desktop UI and copy bug Something isn't working risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff self-test Filed by the product self-test routine (issues only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Friend's first line and its approval card don't arrive live on the sharing home; need a reload (regression of #420)

1 participant