#120 — Einladungslink für bereits Mitglieder/Owner — Weiterleitung statt Fehler #123
Labels
No labels
priority/could
priority/must
priority/should
priority/wont
status/blocked
status/claimed
status/done-migrated
type/bug
type/feature
type/infra
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/todo#123
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story: Einladungslink für bereits Mitglieder/Owner — Weiterleitung statt Fehler
As a Nutzer, der einen alten oder erneut geöffneten Einladungslink zu einer Liste anklickt, in der
ich schon Mitglied oder Owner bin,
I want to direkt zur Liste weitergeleitet werden (mit einem Hinweis, dass ich schon dabei bin),
so that ich nicht mit einer generischen "Einladung ungültig"-Fehlermeldung hängen bleibe.
Background
Root Cause verifiziert im Code:
AcceptListInvitationCommandHandler.cs/AcceptShoppingListInvitationCommandHandler.csselbstbehandeln "schon Mitglied" bereits still und erfolgreich (
isAlreadyMember-Check überspringt nurdas erneute Anlegen der Mitgliedschaft, gibt aber trotzdem das DTO zurück).
CreateListInvitationCommandHandler.cs/CreateShoppingListInvitationCommandHandler.cswiderrufen beim Erzeugen eines neuenEinladungslinks automatisch jeden vorherigen aktiven Link für dieselbe Liste
(
existing.RevokedAt = DateTimeOffset.UtcNow). Ein alter, bereits genutzter oder erneut geteilterLink ist dann
RevokedAt != null→AcceptListInvitationCommandHandlerwirftUnauthorizedAccessException("Invalid or expired invitation link").AcceptInvitePage.tsxfängt jeden Fehler außer "email unverified" in einem generischenstate === 'error'("Invitation invalid") auf — keine Sonderbehandlung für "ich bin eigentlich schondrin".
AC
der eingeloggte Nutzer bereits Mitglied oder Owner der Ziel-Liste ist (aus dem Token selbst oder einer
serverseitigen Zuordnung Token→Liste ableitbar, auch für einen inzwischen widerrufenen Token),
navigiert die App zur entsprechenden Liste statt die generische Fehlerseite zu zeigen.
Mitglied dieser Liste."
"Invitation invalid"-Fehlerseite unverändert bestehen.
Out of scope
beim Klick auf einen dadurch ungültig gewordenen Link wird verbessert).
Claimed for this go-cycle (2026-08-18). Root cause and AC already scoped in the issue body: CreateListInvitationCommandHandler/CreateShoppingListInvitationCommandHandler revoke the previous active invitation link whenever a new one is created for the same list, so a reopened old link hits AcceptListInvitationCommandHandler's UnauthorizedAccessException even though the accept handler itself already treats "already a member" as a silent success. Plan: on accept failure, check server-side whether the current user is already a member/owner of the list the token maps to (even for a revoked token) and redirect to the list with a toast instead of the generic error page; applies to Todo lists, Shopping lists, and Master packing lists. Backend + frontend + tests.
Pushed
5e318e1. Investigation found the story's own AC ("gilt fur alle Listentypen") was unreachable as originally scoped: AcceptInvitePage.tsx unconditionally called AcceptListInvitationCommand (Todo-only) regardless of token type, so Shopping/MasterPacking invite links were silently broken end-to-end (dead backend code paths, confirmed via grep - never called from the frontend). Fixed both issues together with a new AcceptInvitationCommandHandler that resolves the token against all three domains' invitation tables and either delegates to the existing per-type accept handler (still-active token, unchanged behavior) or returns AlreadyMember: true for a revoked/expired token when the user is already a member (the actual #120 fix), instead of throwing. Backend + frontend unit tests added for all three list types. Local build/tests green (Docker unavailable in this sandbox for the DB-backed handler tests - relying on real CI, run 308, to confirm those). Security review: same auth gates as before (authenticated + email-verified), no new information disclosure (generic error unchanged for non-members/nonexistent tokens, already-member response only echoes what the user already has access to).Code is already fully merged on master (commit
5e318e1, "#120: redirect stale-but-already-member invite links; fix Shopping/MasterPacking invite acceptance") from an earlier cycle - the issue was just never closed out. Verified: commit is an ancestor of current master HEAD, introduces a unifiedAcceptInvitationCommandHandlercovering Todo/Shopping/MasterPacking invite tokens with theAlreadyMember: trueredirect-with-toast behavior the AC calls for. No further work needed.Closing as done.