From 1ec190b152999b07a667562950156e101feb592a Mon Sep 17 00:00:00 2001 From: Day Dreamer <87640074+HugoXK@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:03:58 +0800 Subject: [PATCH 1/2] test: a first share-friends read that fails must not keep saying it is loading (#3323) --- plugins/social/test/social.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/social/test/social.test.js b/plugins/social/test/social.test.js index 06b444fc6..02ca96078 100644 --- a/plugins/social/test/social.test.js +++ b/plugins/social/test/social.test.js @@ -15459,3 +15459,15 @@ test('#3075: a local failed hold can be retried again after a retry that failed assert.equal(retries().length, 2, 'a retry that failed again can be tried again') assert.equal(clock.every.length, 1, 'the test drove the dock\'s own poll, not a copy of it') }) + +test('#3323: a first share-friends read that fails must not keep saying it is loading', async () => { + const host = sharingHost(async (endpoint) => { + if (endpoint === 'social/share-friends') throw new Error('social/share-friends: no answer from Bot Social') + return {} + }) + const panel = host.mount('ShareWithFriend', { bot: { id: 'b', name: 'Writer' } }) + await panel.settle() + assert.ok(panel.has('share-list-retry'), 'a failed first read offers a retry') + assert.match(panel.text(), /no answer from Bot Social/, 'the failure is said out loud') + assert.doesNotMatch(panel.text(), /Loading friends…/, 'a failed first read must not keep the loading line') +}) From 7aacc7f3d18ca31b922af34ee21e3c62c3b639d2 Mon Sep 17 00:00:00 2001 From: Day Dreamer <87640074+HugoXK@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:05:49 +0800 Subject: [PATCH 2/2] social: a failed first friends read no longer keeps the loading line (#3323) --- changelog.d/3323.fixed.md | 1 + docs/subsystems/social.md | 2 +- plugins/social/client.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog.d/3323.fixed.md diff --git a/changelog.d/3323.fixed.md b/changelog.d/3323.fixed.md new file mode 100644 index 000000000..1428d41f8 --- /dev/null +++ b/changelog.d/3323.fixed.md @@ -0,0 +1 @@ +The **Share with a friend** card no longer says **Loading friends…** for ever after its first `social/share-friends` read fails: the failed read already draws the error and its **Try again**, so the loading line is now kept only while a read is still on its way, and a later successful read still replaces it as before ([#3323](https://github.com/ThinkFlowLab/FlyBot/issues/3323)). diff --git a/docs/subsystems/social.md b/docs/subsystems/social.md index 1b9a46ea2..cc89721a8 100644 --- a/docs/subsystems/social.md +++ b/docs/subsystems/social.md @@ -112,7 +112,7 @@ for the list is Bot Social's README and `docs/FACE_ROOMS.md` §Auth. - #191: a peer's leave reads `Bob left the room` (the person, from the member's owner name; the Bot label only when there is no owner name), and an ended face room shows a plain status line above the composer (`FaceRoomStatus` on `flybot.session.dock`, `data-flybot=face-room-end`: `Bob left the room. Room closed.` / `You left this room.`). A leave that closes the room is that one line (#1103): the shorter `Bob left the room` is not also posted, and a short leave already in the transcript for a person that status line names is not drawn beside it. A leave that leaves the room open still posts the short line. Joining by number opens the new room in the main pane at once, so the top bar never keeps the previous room's title. - #197: while that status line shows, the composer is hidden (a CSS rule on the composer stack that has `data-flybot=face-room-end`), so a left or closed room is read-only. The account-menu handle uses normal ink. User-facing text no longer names a Friends' Bots section: `relationship_exists` is not an error (#496, below), and a held message to a friend's Bot says it waits for approval in this chat and names the Auto-send setting. - My own handle (`@name.home`) shows with a **Copy** link at the top of the account menu (slot `flybot.account.header`, `MyHandle`) as well as in Add friend (#181). -- Sidebar **+** is a short action menu, not the To:/composer. Add friend has two labelled groups (#343): **Accept an invite** (the full-width paste box `Paste invite link or code`, which wraps so a whole pasted link shows and accepts on Enter (#499), **Talk through [Bot]** when there is more than one Bot, then **Accept invite**) and **Invite a friend** (a **Share [Bot]** picker with the whole Bot name when there is more than one, then the shared invite control below), with a `You are @your.home` line (#181) under the title and **Done** at the bottom (Escape also closes). Typing in the paste box clears a failed accept's error (#499). After **Accept invite** the result shows: `{person} shared {Bot} with you.`, and about 1.8 s later the panel closes on its own and opens the new friend's Bot when its chat is already listed (#499); when the join brought no Bot (`Joined {person}'s invite, but their Bot hasn't loaded yet…`) or sent a request, the panel stays open until **Done** (#343). **Talk through** stays on one line (nowrap label). Add friend and Bot Sharing draw one invite control (`inviteControls` in `client.js`, #499): before a link there is one button, **Copy invite link for {Bot}** (mint + clipboard); then the link sits on its own full-width read-only row above one action row: **Copy link** (the one primary button), **Copy with instructions**, and a quiet **New link** text button that makes a fresh link without copying it (#230). Every copy note names the Bot: `Invite link for {Bot} copied.` / `Invite for {Bot} copied with instructions.`. The Sharing hint is `Invite grants {Bot} only.` and adds `Revoke anytime in People with access.` only once People with access lists someone (`ManageAccess` reports its count through `onGrants`); the empty list says `Nobody has this Bot yet. Copy an invite link above and send it to a friend.` (#499). Below that, **Share with a friend** (#500) lists friends who do not have this Bot yet (one **Share** per friend's Bot, each row named `Bot (Owner)` with that Bot's handle and its own busy state, #973); invite links for new people stay. A read of that list that fails, or that was already in flight when a **Revoke** settled, never replaces the rows a successful read drew: the card updates only from a read that succeeded after the revoke, a failed one keeps the rows and says so with a **Try again**, and `No friends left to share with…` prints only when the last successful read returned nobody (#984). The **Sharing** heading uses the same 4px inset as the core settings headings. The social strip keeps the **N to approve** badge and opens that chat; the stacked jump list stays out of the column. Held `face_room_message` drafts show in that face chat with readable names (`Chief → the room`), never raw `bot_01…` or a `FLYBOT-FACE-HUMAN` envelope. +- Sidebar **+** is a short action menu, not the To:/composer. Add friend has two labelled groups (#343): **Accept an invite** (the full-width paste box `Paste invite link or code`, which wraps so a whole pasted link shows and accepts on Enter (#499), **Talk through [Bot]** when there is more than one Bot, then **Accept invite**) and **Invite a friend** (a **Share [Bot]** picker with the whole Bot name when there is more than one, then the shared invite control below), with a `You are @your.home` line (#181) under the title and **Done** at the bottom (Escape also closes). Typing in the paste box clears a failed accept's error (#499). After **Accept invite** the result shows: `{person} shared {Bot} with you.`, and about 1.8 s later the panel closes on its own and opens the new friend's Bot when its chat is already listed (#499); when the join brought no Bot (`Joined {person}'s invite, but their Bot hasn't loaded yet…`) or sent a request, the panel stays open until **Done** (#343). **Talk through** stays on one line (nowrap label). Add friend and Bot Sharing draw one invite control (`inviteControls` in `client.js`, #499): before a link there is one button, **Copy invite link for {Bot}** (mint + clipboard); then the link sits on its own full-width read-only row above one action row: **Copy link** (the one primary button), **Copy with instructions**, and a quiet **New link** text button that makes a fresh link without copying it (#230). Every copy note names the Bot: `Invite link for {Bot} copied.` / `Invite for {Bot} copied with instructions.`. The Sharing hint is `Invite grants {Bot} only.` and adds `Revoke anytime in People with access.` only once People with access lists someone (`ManageAccess` reports its count through `onGrants`); the empty list says `Nobody has this Bot yet. Copy an invite link above and send it to a friend.` (#499). Below that, **Share with a friend** (#500) lists friends who do not have this Bot yet (one **Share** per friend's Bot, each row named `Bot (Owner)` with that Bot's handle and its own busy state, #973); invite links for new people stay. A read of that list that fails, or that was already in flight when a **Revoke** settled, never replaces the rows a successful read drew: the card updates only from a read that succeeded after the revoke, a failed one keeps the rows and says so with a **Try again**, and `No friends left to share with…` prints only when the last successful read returned nobody (#984). A first read that fails is answered by that error and its **Try again**, not by **Loading friends…**: the loading line stands only while a read is still on its way, so it never outlives the error that replaced it (#3323). The **Sharing** heading uses the same 4px inset as the core settings headings. The social strip keeps the **N to approve** badge and opens that chat; the stacked jump list stays out of the column. Held `face_room_message` drafts show in that face chat with readable names (`Chief → the room`), never raw `bot_01…` or a `FLYBOT-FACE-HUMAN` envelope. ### A group's own header before its first turn (#998) diff --git a/plugins/social/client.js b/plugins/social/client.js index 0f5e9bd9d..fbea88855 100644 --- a/plugins/social/client.js +++ b/plugins/social/client.js @@ -3980,7 +3980,9 @@ window.__ModuleLoader__.load({ } finally { setBusy('') } } const list = friends ?? [] - const loading = friends === null + // 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 return h('div', { className: 'fs fs-card', 'data-flybot': 'share-with-friend' }, h('div', { className: 'fs-name' }, tr('Share with a friend')), h('div', { className: 'fs-hint' }, tr('One click shares {name} with someone you already know. No invite link. They can decline; you can Revoke in People with access.', { name: bot.name || 'this Bot' })),