Retry an upload chunk when the access token expires mid-send #59

Merged
spark merged 1 commits from task/upload-expired-token into main 2026-10-19 16:44:47 +01:00
Owner

Summary

  • A chunk that reaches the server after the 15-minute access token has expired is refreshed and sent again, instead of being marked failed.
  • Uploads start a chunk only with a token that still has a few minutes left.
  • While full originals are being sent, only two photos are read from disk at once, so the window does not freeze long enough for the token to die.

Test plan

  • SDK: a token with under the requested lifetime is refreshed; several callers of a rejected token share one refresh
  • Upload: a 401 on a chunk is retried with the new token; a 415 is not retried
  • Local FTP tests still pass
## Summary - A chunk that reaches the server after the 15-minute access token has expired is refreshed and sent again, instead of being marked failed. - Uploads start a chunk only with a token that still has a few minutes left. - While full originals are being sent, only two photos are read from disk at once, so the window does not freeze long enough for the token to die. ## Test plan - [x] SDK: a token with under the requested lifetime is refreshed; several callers of a rejected token share one refresh - [x] Upload: a 401 on a chunk is retried with the new token; a 415 is not retried - [x] Local FTP tests still pass
spark added 1 commit 2026-10-19 16:44:35 +01:00
Retry an upload chunk when the access token expires mid-send.
ci / rust (pull_request) Successful in 8m18s
ci / typescript (pull_request) Failing after 10m24s
4f5a2fd484
Reading several full originals at once froze the desktop webview, so a chunk left after the 15-minute token had expired and the photo was marked failed.
spark merged commit 54a941101c into main 2026-10-19 16:44:47 +01:00
Sign in to join this conversation.