0082. Quiz attempt deadline holds on every queue driver
Generated from docs/decisions/0082-quiz-attempt-deadline-on-any-queue-driver.md
- Status: Proposed
- Date: 2026-10-09
Context and problem statement
Section titled “Context and problem statement”Starting a GIFT quiz attempt dispatched MarkAttemptAsEnded with ->delay($attempt->end_at). The sync
queue driver ignores the delay and runs the job at once, so the job set end_at to now and the attempt
ended the moment it was created (found in the Phase 3 e2e runs with QUEUE_CONNECTION=sync).
Decision
Section titled “Decision”- The deadline is the attempt’s
end_at, checked server-side on read and submit (QuizAttempt::isEnded(), the attempt policy). That does not depend on any queue. - The delayed job is dispatched only when the default connection can delay
(
MarkAttemptAsEnded::queueCanDelay(): notsync, notnull). - The deadline job carries
atDeadline = trueand never ends an attempt whoseend_atis still in the future, so a misconfigured driver cannot end it early. Submitting and the explicit “end attempt” endpoint still end it immediately. - No scheduled sweep: there is no “finalised” marker column, and adding one is a data-model change that this fix does not need.
Consequences
Section titled “Consequences”- With
sync(ornull) no event is fired when a deadline passes without a submit; scoring, status and access are still correct because they derive fromend_at. - Tests cover
sync,null,databaseandredis.