Repository navigation
fix(social): face-room poll empty handle and approval notice delivery (#122 #123) - #128
Conversation
Empty or missing handles no longer persist as "@" on face-room poll, which was 404-spamming GET ?as=@. A stored bogus "@" is healed, and list-discovered rooms seed asBot from my_bots. Held-approval waiting notices open a listed friend Bot 1:1 instead of delivering to a home-level handle with no session (resume failed for session "undefined"). If no chat can be opened, the notice is skipped with a clear log. Fixes ThinkFlowLab#122 Fixes ThinkFlowLab#123 Co-authored-by: Danyang Chen <birfychen@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f910e66672
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { ...meta, asBot, asBots } | ||
| } | ||
| function listedAsBot(snapshot) { | ||
| const mine = (snapshot?.myBots ?? []).map(bot => norm(bot.handle)).find(Boolean) |
There was a problem hiding this comment.
Preserve every local Bot when seeding room metadata
When a room is first discovered (or repaired) with multiple entries in my_bots, this collapses them to one handle, and applyFaceSnapshot consequently persists only that handle in asBots. leaveFaceRoom later builds both the REST bots payload and room-only identity cleanup from asBotsOf(meta), so leaving such a discovered room removes only the first Bot while the other local Bots remain joined and their room-only identities linger. Keep the full set of listed local handles while selecting just one polling identity.
Useful? React with 👍 / 👎.
| const deliver = service.remote?.chats?.deliver ?? flybot.remote?.chats?.deliver | ||
| if (item?.to && deliver) { | ||
| try { await deliver({ handle: item.to, text, name: 'Room' }) } catch (error) { warn('approval chat note failed', error) } | ||
| const chats = service.remote?.chats ?? flybot.remote?.chats |
There was a problem hiding this comment.
Use the scoped chat API when opening approval sessions
When the selected friend Bot has no existing 1:1 session, the normal startSocial(ctx.flybot) path chooses the unscoped service.remote.chats API here. Its open records the new remote Bot under plugin shared, while Social registers its outbound handler on the scoped flybot.remote.chats; replying in the newly opened chat therefore reports that its plugin is not running instead of sending through Social. Prefer the scoped chat API for both opening and delivery.
Useful? React with 👍 / 👎.
Fixes #122
Fixes #123
#122 Empty or
@handles stay empty (norm, RESTget, hide-handle). A storedasBot: "@"is healed, and the poll only sendsaswhen it is a real handle. Rooms discovered throughlistare seeded frommy_bots. Aface_room_not_foundon a room that is still listed repairs the meta and retries once.#123 Approval waiting notices no longer call
deliverwith a home-level handle. They open or resolve a listed friend Bot's 1:1 chat so the line lands in the chat. If there is none, they skip withapproval chat note skipped: no 1:1 chat for …instead of throwing.ARCH_DOCS_BASE=upstream/main npm run verifypasses;ds-bot/untouched, no patch regeneration.