Repository navigation
Description
Observed behavior
When a recording delivery is retried after the Drive share already succeeded, the deadline the row records can be later than the expiry Drive holds. The candidate's access then ends before the date the row and the status route report.
The sequence at 55597864:
- Attempt one computes
expires_at = clock.now() + retention_secondsand shares the file through Drive with it (src/recording/transfer.rs:38-40), andshare_filestores the permission id (src/recording/transfer.rs:257). - The write that marks the delivery finished fails, so the delivery is rescheduled.
- Attempt two computes a new
expires_atfrom the clock.share_filefindsuploaded.existing_permissionand makes no second share call, so Drive keeps the first expiry.finishthen records the new, later one (src/recording/transfer.rs:43).
The gap is the time between the two attempts: the retry backoff is 60 seconds after the first failure and 300 after the second (DELIVERY_BACKOFF_SECONDS), plus the time the second attempt spends before it reaches the share step.
Expected behavior
The recorded deadline equals the expiry the Drive permission holds. RETENTION_SECONDS in src/recording/queue.rs:213-216 says the permission and the deletion deadline have to be the same number or one of them is a lie.
Reproduction
Read from the code, not run.
- Deliver a recording with a Drive double that accepts the share and a database write that fails once in
finish. - Advance the clock by the retry backoff and run the queue again.
- Compare the permission's
expirationTimein the double withrecordings.expires_at: they differ by the elapsed time.
CodeTrial version
desktop-latest-25-g55597864
Environment
Not environment specific.
Sanitized evidence
None. The error is in the safe direction: access ends early, and the retention sweep deletes later than the access ended, so nothing stays readable longer than reported. The status route can show a deadline the candidate no longer has.
A fix needs the permission's expiry stored with its id, so a retry records what Drive holds. That is a schema change on the recordings table, so it needs a maintainer decision before code. The alternative is to read the expiry back from Drive on retry, which costs one more provider call per retried delivery and is subject to docs/provider-cost-and-degradation.md.
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
Activity
Ezechungi7 commentedon Nov 15, 2026
I inspected
src/recording/transfer.rs,src/recording/store.rs,src/recording/summary.rs, andsrc/accounts/schema.rsto compare the options for keepingrecordings.expires_atequal to the Drive permission'sexpirationTimeacross retries, these are the possible solutions:expires_atalongsidedrive_permission_idin the existingrecordings.expires_atcolumn (no schema migration or extra Drive call):set_drive_permission(src/recording/transfer.rs:552) can writeSET drive_permission_id = ?2, expires_at = ?3atomically when the share succeeds, anddelivery_handles(src/recording/store.rs:482) can return the storedexpires_atalongsidedrive_permission_idso a retry passes the existing expiry intofinish_delivery(src/recording/transfer.rs:585).due_for_deletion(src/recording/summary.rs:120) already filtersstate IN ('ready', 'failed', 'cleanup_failed'), so atransferringrow is not swept early; ifexpires_atshould also remain hidden on the status route (src/web/recordings/mod.rs:473) untilfinish_deliverymarks the rowready,RecordingSummarycan exposeexpires_atonly onceready_atis set (orforget_drive_filecan clearexpires_at = NULLalongsidedrive_permission_id = NULLon a lost race).drive_permission_expires_at INTEGERcolumn (src/accounts/schema.rs):set_drive_permissionrecords(drive_permission_id, drive_permission_expires_at),forget_drive_fileandHandle::DrivePermission(src/recording/store.rs:518) clear both, andrecordings.expires_atstaysNULLuntilfinish_deliverycopiesdrive_permission_expires_atintoexpires_at, at the cost of a schema migration insrc/accounts/schema.rs.expirationTimeback from Drive on retry (GET /drive/v3/files/{fileId}/permissions/{permissionId}?fields=expirationTime):share_file.Options 1 and 2 both avoid the extra Drive API call on retry. Is there any approach you lean more towards to?
jserv commentedon Nov 15, 2026
Option 1 looks good. You have to consolidate validation plans as well.
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry
Keep Drive permission expiry across delivery retry