Skip to content

bug(org-workbench): stale card actions mix previous employee with new selectedId #420

Closed

Description

@sun-970

Summary

#417 (ac916af) kept the previous PositionCard while the next position() is in flight (stale-while-revalidate). That is correct for not flashing a skeleton. It does not align identity.

During that one local position() round-trip:

  • selectedId is already B
  • card.data / selectedPosition is still A
  • the card header actions mix the two: DismissPositionDialog shows A's name, onDismiss / setEditTargetId fire B's id

Extreme case: the dismiss dialog names A and actually dismisses B. The window is short and normally unclickable; still a 张冠李戴 if it is clicked.

Repro (test-level)

  1. Select owner A. Wait until the card heading is A's.
  2. Hold B's position() so it does not resolve.
  3. Click B in the org tree.
  4. Card heading is still A (SWR, intended).
  5. Because selectedId !== owner, the 裁撤 button appears on A's card and the dialog title is A's name, but confirm calls delete on B.

Expected

Stale-while-revalidate only covers visual continuity (keep A's card/thread, no skeleton). Mutating actions that send selectedId must not run against a card whose data.id is still A.

  • Hide edit / dismiss while card.data?.id !== selectedId.
  • After B's record arrives, actions bind only to B.

Out of scope

Do not revert #417 SWR for the card heading or thread. Do not skeleton the panel again.

Context

Follow-up from review of #417. Not a merge blocker.

Activity

  1. sun-970 commented on Sep 21, 2026

    @sun-970
    CollaboratorAuthor

    Implementation: #421
    Head keeps #413 SWR; card edit/dismiss wait until card.data.id === selectedId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions