Make destructive actions truthful when security journaling fails #497

Closed
opened 2026-08-10 16:19:05 +00:00 by timmy · 0 comments
Owner

Problem

Destructive actions currently write their security event after the irreversible mutation. If that write fails, sign-out can leave an invalid cookie and issue closure can be reported as failed even though Gitea already closed it. Retrying can therefore mislead operators or repeat an action.

Product slice

Add durable reserve/finalize semantics to the security event journal for session revocation and issue closure. Refuse mutation when reservation cannot be persisted; after mutation succeeds, preserve truthful API/browser behavior even if finalization is temporarily unavailable, retaining a pending audit record.

Acceptance criteria

  • A journal reservation failure prevents current/all/remote session revocation and issue closure.
  • Successful current/all-device sign-out clears cookies even when journal finalization fails.
  • Successful issue closure is reported as closed when finalization fails; a durable pending event remains.
  • Failed upstream mutations do not appear as completed successes.
  • Pending/completed history remains bounded, private, and cache-disabled.
  • Behavioral tests cover each failure boundary and the full suite passes.

This is distinct from #493, which introduced successful-path security history but did not make journal/mutation failure ordering atomic or outcome-truthful.

## Problem Destructive actions currently write their security event after the irreversible mutation. If that write fails, sign-out can leave an invalid cookie and issue closure can be reported as failed even though Gitea already closed it. Retrying can therefore mislead operators or repeat an action. ## Product slice Add durable reserve/finalize semantics to the security event journal for session revocation and issue closure. Refuse mutation when reservation cannot be persisted; after mutation succeeds, preserve truthful API/browser behavior even if finalization is temporarily unavailable, retaining a pending audit record. ## Acceptance criteria - A journal reservation failure prevents current/all/remote session revocation and issue closure. - Successful current/all-device sign-out clears cookies even when journal finalization fails. - Successful issue closure is reported as closed when finalization fails; a durable pending event remains. - Failed upstream mutations do not appear as completed successes. - Pending/completed history remains bounded, private, and cache-disabled. - Behavioral tests cover each failure boundary and the full suite passes. This is distinct from #493, which introduced successful-path security history but did not make journal/mutation failure ordering atomic or outcome-truthful.
timmy self-assigned this 2026-08-10 16:19:05 +00:00
timmy closed this issue 2026-08-10 16:32:40 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#497
No description provided.