Repository navigation
Name an unnamed group on load with the formula that sees the room - #1977
Merged
Merged
Conversation
`load()` compared the stored title against `autoRoomName(members, room)` and then wrote `autoRoomName(members)`, which drops the people and the remote guests that `room.participants` carries: the owner became `You`, every guest fell out of the title, and the wrong name could never match again, so every boot rewrote state.json and the group Session title. Both halves now use one computation that passes the room (ThinkFlowLab#1976). Docs-not-needed: the load path now stores the same `autoRoomName(members, room)` value the rest of the host already uses; no module boundary, API or documented contract changes.
Collaborator
|
Verdict: PASS at ba5140b Ran at this tip: Red first, reproduced: with only Review points:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1976
Written-by: Dev-3
Owner: Dev-3
Reviewer: Birfy
Claim-Id: f0e963a6ce604c81a669c3c389ade5cc
Branch: dev/3-store-auto-name-consistency
Base: 90b880e
What was wrong
load()brings an unnamed group's stored title up to date in two steps that used different formulas (core/src/host/store.js):The comparison passes
room; the assignment does not.rt.autoRoomName(members, room)(core/src/host/roster.js:257-263) takes the human people and the remote guests fromroom.participants; called withoutroomit seesparticipants = [], sohumans = []→people = ['You']andremotes = [].Any stored title that no longer equals the live formula — the join path does not recompute an unnamed title after a seat change, which is out of scope here and recorded on the issue — was therefore replaced by the narrow one: the owner became
Youand every remote guest fell out of the name. LiveAlice, Chief A, Chief BbecameYou, Chief A, Chief Bwith theCoderguest gone.Two side effects come from the same line and stop with it:
migratedis true on every start andstate.jsonis rewritten on every boot (store.jsload()).rt.retitleRoomin the sameload()), so the sidebar carriedYou, …as well.What changed
room:const next = rt.autoRoomName(room.members, room); a room whose stored name already equalsnextis left alone, a stale one is renamed tonextand reported for the one Session retitle. The next boot then finds the file matching and neither renames nor rewrites.autoRoomNameitself is untouched, as arenotifyRoomShareandfollowMemberNames(host: an automatic group rename (member rename or removal) never reaches the guests #1970/test: pin that a rename which leaves the computed name alone sends no room-share envelope #1971).node scripts/ds-bot-patches.mjs generate→patches/ds-bot/0002-flybot-api-host.patchandpatches/ds-bot/files/test/remote-room.test.js. One changelog fragment (changelog.d/1976-store-auto-name.fixed.md). No subsystem-doc update: the load path now stores the sameautoRoomName(members, room)value the rest of the host already uses, so no boundary or documented contract changes (Docs-not-needed:in both places).Red first, on base
90b880e7The new case is in
core/test/remote-room.test.jsand goes through the real store and roster (host()installsstore.js,roster.js,member-auth.js,authz.js,room-membership.js,reach.js): it builds an unnamed group with the human owner and two Bots, adds a remote guest without recomputing the title, saves, and lets a second hostload()the same bytes. On the base, with the source untouched:The same case on the tip is green, and it also pins the two follow-ons: the next boot keeps
Alice, Chief A, Chief B, Coder, writes no bytes and retitles no Session; a file still carrying the old narrow string is migrated to the live name once and is left alone on the boot after that.Verification at the tip
ba5140b1ef5352481f294a2e9df39eeab8e56e71Ran on the committed tree (
git status --porcelainempty):TZ=UTC ARCH_DOCS_BASE=90b880e7 npm run verify: exit 0 — core 2375/2375; core lint 73 warnings, 0 errors; plugin lints 36 / 9 / 2 / 16 warnings, 0 errors;arch-docs: OK (5 changed file(s));build-client --checkgreen;ds-bot-patches check: pinFei2411/DeepSeek-Bot@2b10c70, 10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/; plugins social 541, tree 127, timeline 135, workflow 336;.github/scripts563; interop 37, live-e2e 24 — 0 failures everywhere.node .github/scripts/changelog.mjs check: 10 fragments well formed.node .github/scripts/check-mojibake.mjs --checkis not needed here: nothing outside UTF-8 text was regenerated by hand.Not run:
dev/bench.sh): it needs adeepseek-harnesscheckout beside the repo, and this box has none. The change is theload()name computation instore.js; the new case drives the realload()/save path, and the full core suite is green.Checkpoint
{ "pr": 1977, "claim": "Dev-3", "issue": 1976, "summary": "load() compared an unnamed group's stored title with autoRoomName(members, room) and then wrote autoRoomName(members), which names the owner You and drops the remote guests because room.participants is not passed. The wrong name never matched again, so every boot rewrote state.json and the group Session title. The filter and the write are now one computation that passes room, so a restart migrates an old title once and then leaves the file and the title alone. One changelog fragment; autoRoomName, notifyRoomShare and followMemberNames are untouched.", "files": [ "core/src/host/store.js", "core/test/remote-room.test.js", "patches/ds-bot/0002-flybot-api-host.patch", "patches/ds-bot/files/test/remote-room.test.js", "changelog.d/1976-store-auto-name.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=90b880e7 npm run verify; node .github/scripts/changelog.mjs check", "result": "green", "at": "ba5140b1ef5352481f294a2e9df39eeab8e56e71" }, "next": "none — ready for review" }