Repository navigation
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4307077a6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This comment has been minimized.
This comment has been minimized.
Update the image recovery helper and its tests to use the status-only HEAD API.
Explanation of Change
Load authenticated images with their existing credentials instead of starting reauthentication from a client-side session-age estimate. After a load failure, reuse already-updated credentials or confirm HTTP 401 with an authenticated HEAD request before entering the existing authentication flow; preserve successful image sources so routine token updates do not reload them.
Deploy the companion backend change first so rejected image-token requests return 401 without a login redirect.
Fixed Issues
For https://github.com/Expensify/Expensify/issues/696902
$ #105498
PROPOSAL: N/A (internal change)
Tests
X-Chat-Attachment-Tokenheader.const old = await Onyx.get('session').SignOutAPI with the second session's ownauthToken. This revokes every token for the account. NewDot's own sign-out (LogOut) only deletes its device login and does not revoke other sessions.ReconnectApp, which returns 407 and reauthenticates through the API middleware. Verify the images already on screen are not requested again.await Onyx.merge('session', {authToken: old.authToken, encryptedAuthToken: old.encryptedAuthToken}); await caches.delete('auth-images');, then open an image in the attachment viewer.oldis now a server-revoked token.GETreturns 401;HEADto the same URL returns 401;Authenticateruns, even though the viewer also loads the neighbouring image;GETis retried with a new token, returns 200, and the image displays.Authenticateruns and the thumbnails load.auth-images, and remount the chat. Verify theHEADcheck returns 404, noAuthenticateruns, and the broken-image placeholder is shown.Offline tests
QA Steps
Test 1 steps
Test 2 steps
Note : on native platforms, the troubleshooting test tool "Authentication Status/Invalidate with delay" can be used to simulate expiring the session in the next 15 seconds when clicked.
Test 3 steps
Note : on native platforms, the troubleshooting test tool "Authentication Status/Invalidate with delay can be used to simulate expiring the session in the next 15 seconds when clicked.
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Step 2: JPG attachment sent and rendered
Step 2: PNG attachment sent and rendered
Steps 6-7: attachment viewer loading with the revoked token (GET 401, then HEAD 401)
Steps 6-7: after one Authenticate, the retry with the new token returns 200 and the image displays
Step 8: thumbnails remounting with the revoked token
Step 8: thumbnails loaded after one shared Authenticate
Step 9: a 404 shows the broken-image placeholder, with no Authenticate
Step 10: message sent after recovery