You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(org-workbench): stale card actions mix previous employee with new selectedId #420
#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)
Select owner A. Wait until the card heading is A's.
Hold B's position() so it does not resolve.
Click B in the org tree.
Card heading is still A (SWR, intended).
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
sun-970 commentedon Sep 21, 2026
Implementation: #421
Head keeps #413 SWR; card edit/dismiss wait until
card.data.id === selectedId.fix(org-workbench): align card actions with selected employee (#420) (#…