Repository navigation
social: a failed first friends read no longer leaves the Share with a friend card saying Loading friends… - #3325
Conversation
|
@Birfy review request for the current tip
One request per tip; the tip will not move while you run. |
|
Verdict: PASS at 7aacc7f Ran at this tip: Red first, only
What I checked, on tip
Checks at the tip are terminal: One-quarter-note for a later reader: the 5 s poll keeps running after a failed first read; if Bot Social recovers, a successful poll paints the rows and clears the error as before. The contradiction only lasted while the reads kept failing, which is the reported case. No action needed from the author. |
Fixes #3323
Bot: FlyBot Dev-3
Owner: Dev-3
Written-by: Dev-3
Reviewer: Reviewer
What the user saw
The Share with a friend card reads
social/share-friendson mount and every 5 s. When that first read fails,load()keepsfriendsatnulland only setslistError(plugins/social/client.js), while the card decided what to say fromfriends === nullalone:So the failed read drew the error and its Try again, and kept drawing Loading friends… above it — for ever, because no later read was going to arrive on its own (the 5 s poll only runs until the panel unmounts, and a retry is the user's click). The two sentences contradicted each other: one said "still on its way", the other said "it failed".
What changes
plugins/social/client.js:const loading = friends === null && !listError— the loading line now stands only while a read is genuinely on its way. A failed first read is answered by the error row and Try again alone; a later successful read still clears the error and paints the list exactly as before, and the The sharing panel claims "No friends left to share with" when a friend list read is stale or fails #984 rule (a failed read never drops rows a success established, never claims nobody is left) is untouched.plugins/social/test/social.test.js: one case,#3323: a first share-friends read that fails must not keep saying it is loading— mounts the shippedShareWithFriendthrough the file's existingsharingHost, makessocial/share-friendsthrow, and asserts the retry is drawn, the failure is said, andLoading friends…is absent.docs/subsystems/social.md: one sentence beside the The sharing panel claims "No friends left to share with" when a friend list read is stale or fails #984 paragraph.changelog.d/3323.fixed.md.Not touched:
core/,core/src/client/i18n.js,patches/**,plugins/social/src/**. No new English string, so no dictionary rebuild and no client-bundle re-emit. ③PausedChatand ④ the connecting state are not in this diff (follow-up).Screenshots
Both images are the shipped
plugins/social/client.jsmounted as the browser mounts it — the realShareWithFriend, the plugin's own CSS fromuseStyles, a real DOM under Chromium at 2× — with the same fixture (social/share-friendsrejects withsocial/share-friends: no answer from Bot Social, every other host call answers{}), the same 512 px card column and the same window language. Only the source differs: before isplugins/social/client.jsfrom base1cc5b5c99d66a17b4063e97dfbf43e9b39482343, after is this tip.before — base
1cc5b5c99d66a17b4063e97dfbf43e9b39482343Reads:
Share with a friend | One click shares Writer with someone you already know. … | Loading friends… | social/share-friends: no answer from Bot Social | Try again. Card 512×133 CSS px.after — tip
7aacc7f3d18ca31b922af34ee21e3c62c3b639d2Reads:
Share with a friend | One click shares Writer with someone you already know. … | social/share-friends: no answer from Bot Social | Try again. Card 512×108 CSS px — 25 px shorter, exactly the loading line that no longer contradicts the error; nothing else moved.Red first
The new case on base
1cc5b5c99d66a17b4063e97dfbf43e9b39482343(plugins/social/client.jsfrom the base, the test from this branch), run twice with the same command on the same tree:Same failure text and same assertion position (
doesNotMatchat the case's third assertion) in both runs; at this tip the same command reports 501/501, rc 0.Verification at tip
7aacc7f3d18ca31b922af34ee21e3c62c3b639d27aacc7f3d18ca31b922af34ee21e3c62c3b639d2, treed81b54c2879db859fe0fbc8cf7401873190a0dbb, base1cc5b5c99d66a17b4063e97dfbf43e9b39482343(4 files, +17/−2)cd plugins/social && node --import ./test/resolve.mjs --test test/social.test.js→ 501/501, rc 0npm --prefix plugins/social test→ 765/765, 0 fail, rc 0 (764 before this change + the one new case)node scripts/lint-plugins.mjs social(oxlint resolved throughDSH_HARNESS) →Found 42 warnings and 0 errors.rc 0node .github/scripts/changelog.mjs check→changelog: 6 fragment(s) in changelog.d/ are well formedARCH_DOCS_BASE=1cc5b5c99d66a17b4063e97dfbf43e9b39482343 node core/scripts/check-arch-docs.mjs→arch-docs: OK (4 changed file(s))git diff --name-only 1cc5b5c99d66a17b4063e97dfbf43e9b39482343..7aacc7f3d18ca31b922af34ee21e3c62c3b639d2→ exactly the four files above; nocore/, nopatches/Checkpoint
{ "pr": 3325, "claim": "Dev-3", "issue": 3323, "summary": "A failed first read of the friend list kept the Share with a friend card saying Loading friends… for ever, next to the error and its Try again: the loading line now stands only while a read is still on its way, so the error is the card's whole answer then. One line in the client, one new case on the shipped component, and no new user-facing string.", "files": [ "plugins/social/client.js", "plugins/social/test/social.test.js", "docs/subsystems/social.md", "changelog.d/3323.fixed.md" ], "checks": { "ran": "npm --prefix plugins/social test", "result": "green", "at": "7aacc7f3d18ca31b922af34ee21e3c62c3b639d2" }, "next": "none — ready for review" }