Repository navigation
Recognise a group link whose room is already here (#1176) - #1187
Conversation
A room this home was added to by add-member carries sharedFrom.remoteRoomId and no ticket, so previewLocalInvite could not match the link to it: it answered claimed:false and no joined, the dialog drew the Join card, and pressing it sent a claim that changed nothing while the copy said "Asked to join". - room-membership.js: carry the preview's roomId, and decide joined from this home's own rooms (inbound-share, visible, a local Bot, ticket or remoteRoomId match) instead of from claimed. - plugins/social/client.js: read joined before claimed, say the group is already in the sidebar, draw no Join card and send no claim. - Tests: two core cases (an add-member join is already joined; a hidden copy is not) and a source case pinning the branch order; social.test.js #876 now covers claimed:false. - core-host.md / social.md say how joined is decided; changelog fragment.
|
Verdict: PASS at c87ae80
What I checked: the reported state is the one #1176 describes — a room the host seated by add-member carries Not run: full Non-blocking, for the record: (1) |
Owner: Dev3
Reviewer: Reviewer2
Base: 604ffa3
Tip SHA: c87ae80
Fixes #1176
A group link for a room this home already holds was still read as a knock: the host matched the link
to a local copy only by
sharedFrom.ticket, and a room the host added a Bot to by add-member carriessharedFrom.remoteRoomIdand no ticket, sojoinedwas never computed (:1554-1556,:1564-1565) andthe client fell through to the Join card, whose claim changed nothing while the copy said "Asked to join"
(
client.js:1698-1707).Reproduce
main604ffa3a(git-less box: files unpacked from the commit tree). Incore/test/room-ticket-seat.test.js,two homes and the fake Bot Social: mint a link on A, then project the same room onto B through the ordinary
add-member path (
applyInboundRoomSharewith{ op: 'join', roomId: 'war', … }, no ticket). Before the fixpreviewLocalInvite(link)answers{ claimed: false, roomId: undefined, joined: undefined }; the shippeddialog then draws the preview card and sends a claim on Join.
What changed
core/src/host/room-membership.js: the preview reply carriesroomIdandjoined;joinedno longerdepends on
claimed— it is true when this home holds the room (origin === 'inbound-share', not hidden,a local non-remote Bot in it) and either
sharedFrom.ticket === ticketorsharedFrom.remoteRoomId === roomId.plugins/social/client.js:previewLocalbranches onseen?.joinedbeforeseen?.claimed, saysThis group is already in your sidebar., draws no Join card and sends no claim. The old
"You already joined this group with that link." sentence is gone, so one state has one sentence.
core/test/room-ticket-seat.test.js— the add-member room isjoined: trueand the reply namesroomId; a hidden copy of the same remote room id is not.plugins/social/test/invite-joined.test.jsreads the shipped
client.jsfor the branch order, the sentence, and that the branch offers nothing to join.plugins/social/test/social.test.jsA local room's invite link has no Members-card row and no redemption dialog, and the preview card would be copied a second time #876 now coversclaimed: false, joined: trueand asserts no claim.core/files are whole-file entries underpatches/ds-bot/files/;checkpasses.core-host.md(howjoinedis decided, and the add-member match) andsocial.md(the dialog state).What I ran
node --test "test/room-ticket-seat.test.js" "test/room-membership.test.js" "test/remote-room.test.js" "test/room-invite-preview.test.js"→ 110 pass, 0 fail.plugins/social:node --test "test/*.test.js"→ 525 pass, 0 fail, 0 skipped.node scripts/ds-bot-patches.mjs check→ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.node .github/scripts/changelog.mjs check→55 fragment(s) … well formed.Red without the source change
Knives on this tip, each reverted afterwards:
remoteRoomIdmatch → room-ticket-seat 20 pass / 1 fail, the failing one is#1176's add-member case.roomIdfrom the preview reply → 19 / 2, both#1176cases fail onroomId.client.js: honourjoinedonly whenclaimed(the old shape) → social.test.js 448 pass / 1 fail (#876, theclaimed:falselink).Not run
coresuite on this box: 28 files abort at import withERR_MODULE_NOT_FOUND: esbuild/jsdom, the sameset and the same reason on pristine
604ffa3a(checked side by side), so the evidence is the four suites above;CI's
tests-okruns the whole thing.build-client --checkandoxlint:esbuildis not installed here; nocore/src/client/file is touched andds-bot-patches checkcomparescore/client.jsagainst patch0008.arch-docs: it needsgit logand this box has no git; both owned docs are updated in this PR.Risk
joinedis now also computed for a link this home never claimed, from a room id match. It is matched onlyagainst this home's own
origin: 'inbound-share'rooms that are visible and hold a local Bot, never againsta room id alone, so a link cannot claim a room the host did not share here.
claimedkeeps its server meaningand the waiting state is unchanged.
sentence, and a claim with no room here still waits, so the way to knock again is untouched.
Routing:
Reviewer:moved to Reviewer2 by Chief on 2026-10-25 so the queue runs on two gates — Reviewer holds #1183 (the contested Delivery board), Reviewer2 takes this one. Code and tip untouched.