Problem
Currently, claims created through the camera flow remain in pending state indefinitely if the QR code is not scanned.
The Raspberry Pi camera app continuously polls for claim status (# Don't stop polling), which means:
- Unclaimed photos lead to infinite polling loops
- The claim database accumulates stale entries over time
- At large events, this can result in unnecessary load and degraded system behavior
Why this matters
In real-world usage, it is common for users to take photos but not complete the claim flow.
Without a lifecycle mechanism:
- Stale claims are never cleaned up
- Polling continues indefinitely
- System behavior becomes inefficient over time
Proposed Solution
- Add an
expires_at field to claims
- Assign a TTL (default: 15 minutes) at claim creation
- Introduce a periodic cleanup job to mark expired claims
This ensures:
- Proper lifecycle management of claims
- Reduced unnecessary polling
- Cleaner and more predictable system behavior
Problem
Currently, claims created through the camera flow remain in
pendingstate indefinitely if the QR code is not scanned.The Raspberry Pi camera app continuously polls for claim status (
# Don't stop polling), which means:Why this matters
In real-world usage, it is common for users to take photos but not complete the claim flow.
Without a lifecycle mechanism:
Proposed Solution
expires_atfield to claimsThis ensures: