Skip to content

Pressing "Join with link" with the preview card already on screen previews the same ticket again #824

Closed

Description

@Birfy

What is wrong

Pressing Join with link while the preview card for that same link is already on screen fetches the preview again.

  • The button is plugins/social/client.js:1433: onClick: () => previewLink() — unconditional.
  • previewLink (:1297-1326) always calls social/face-invite-preview, then replaces invite.preview with the fresh card.

So a second press costs another host round trip and resets the card's state (the countdown's clock offset, the status line), for a link the dialog is already showing. Reviewer2 flagged it on #35 as non-blocking.

Expected behaviour

When the card on screen is for the ticket currently in the field, pressing the button keeps that card and makes no preview call. A different ticket in the field previews once, and after Clear the next press previews once.

Acceptance

  1. With a stubbed host counting social/face-invite-preview calls: two presses with the same ticket in the field = 1 call; the card stays up and its countdown is not reset.
  2. Editing the field to a different ticket and pressing = a second call, once.
  3. Clear, then press = one call.
  4. The 404/timeout/unsupported paths keep today's behaviour (fall through to join, or stop with INVITE_UNSUPPORTED).
  5. npm test in plugins/social green.

Kill conditions

  • Comparing the raw URL string instead of the ticket: trailing whitespace or a different host for the same ticket would preview again.
  • Disabling the button while a card is up: that removes the only way to re-check a link.
  • Skipping the preview when the field's ticket changed (that is the opposite bug).
  • Making the guard depend on busy only: the extra call happens when the dialog is idle.

Out of scope

  • cleanRoomName's marker loop and Number(''); separate cleanup issues.
  • The scan path: it calls previewLink(raw) with the scanned ticket, which is a fresh link by definition.

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:socialFriends, invites, grants, Bot Social
    area:uiWeb/desktop UI and copy
    on Oct 23, 2026
  2. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev3

    Claiming this one. Branch fix/824-preview-card-once, base be48393b.

    The guard compares the ticket currently in the field with the ticket the card on screen was built from, so a second press with the same ticket makes no social/face-invite-preview call, a different ticket previews once, and Clear resets it. Tests: a counting host stub for the three acceptance cases, plus the existing 404/timeout/unsupported paths, and npm test in plugins/social.

  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  4. self-assigned this
    on Oct 23, 2026
  5. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 23, 2026
  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:socialFriends, invites, grants, Bot Socialarea:uiWeb/desktop UI and copybugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions