Repository navigation
fix(social): preview an invite link once while its card is up (#824) - #843
Conversation
Pressing Join with link again with the card on screen spent another host round trip and rebuilt the card, losing its countdown. The press keeps the card when the ticket in the field is the one it already shows; a field edit or Clear still looks the link up once.
|
Verdict: PASS at 14a052c Ran: The guard sits where it has to: after Removing the one line reddens exactly one case — the idempotence test — and leaves the different-ticket/edit/Clear case green, which is what makes the tests load-bearing rather than a pair of mirrors. The first test's No blocking issues. One consequence is worth keeping in mind, and the PR already states it under Risk: a room whose preview data changed server-side (a member joined) no longer refreshes while its card is up — the field edit or Clear is the refresh, and the scannner shares CI at this tip: every substantive check green; only |
Fixes #824
Written-by: Dev3
Tip SHA: 14a052c
Reproduce
FaceToFaceGroup's Join with link button ranpreviewLink()unconditionally (plugins/social/client.js), andpreviewLinkalways calledsocial/face-invite-previewand replacedinvite.preview. So pressing it while the card for that same link was on screen spent a second host round trip and rebuilt the card — its countdown offset and status line reset for a room the dialog was already showing.The new tests in
plugins/social/test/social.test.jspress the button twice with the same link in the field: the host stub countssocial/face-invite-previewcalls and answers a different room name on a second call, so the test fails on both the count and the card's name before the fix.What changed
plugins/social/client.js:previewLinkreturns beforesetBusy/the host call wheninvite.preview?.ticketis the ticket parsed out of the field. The guard compares the parsed ticket, never the typed text, so the same link spelled differently is still the same card.plugins/social/test/social.test.js: two tests — pressing twice with the same ticket makes one call, keeps the card and joins nobody; a different ticket previews once and follows the new ticket, a field edit drops the card, and Clear lets the same link be looked up once more.docs/subsystems/social.md: the invite bullet says what a second press does now.changelog.d/824-preview-card-once.fixed.md.Nothing under
core/changed, sopatches/ds-bot/is untouched.What I ran
At the tip, in
plugins/social/:Red without the source change
Removing the guard (
if (invite.preview?.ticket === ticket) return) and re-running the suite:Only the new idempotence test goes red; the other #824 test (a different ticket, a field edit, Clear) still passes, because it exercises the paths that must keep working.
Not run
dialogWithState).core/suite: nothing undercore/changed in this PR, so the copy I ran locally would only repeat CI. CI'stests-okcovers it at this tip.previewLink, and its existing tests stay green.Risk
404/timeout still falls through to the join, andunsupportedstill stops with the same sentence.