[No QA] Improve short delay before showing Concierge suggested response answer #82154
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e90ed5b3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.PENDING_CONCIERGE_RESPONSE}${reportID}`, | ||
| value: { |
There was a problem hiding this comment.
Queue pending concierge responses instead of overwriting
Storing each delayed Concierge reply at a single key (pendingConciergeResponse_<reportID>) means a second pre-generated followup selected within the same 4s window replaces the first pending action. Because the hook re-subscribes on key changes, the first timer is cleared and only the most recent response is ever applied, so earlier optimistic Concierge replies can be silently dropped in reports where multiple followups are resolved quickly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
There should be only one follow up for the report in that 4s window.
|
@mkhutornyi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26e90ed5b3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (remaining < -STALE_THRESHOLD_MS) { | ||
| discardPendingConciergeAction(reportID); |
There was a problem hiding this comment.
Avoid discarding queued response after routine navigation
The stale guard drops pending responses whenever displayAfter is more than 10s old, but this path is also hit during normal navigation (not just app restarts): useEffect clears the timer on unmount, so if a user leaves the report and comes back after ~10s, the queued Concierge reply is discarded instead of shown. This regresses the delayed-response flow for active sessions and can make a selected follow-up appear to have no Concierge answer.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
if a user leaves the report and comes back after ~10s, the queued Concierge reply is discarded instead of shown. This regresses the delayed-response flow for active sessions and can make a selected follow-up appear to have no Concierge answer.
Is this expected?
There was a problem hiding this comment.
The optimistic follow up is later replaced by actual response that comes from Concierge on BE. I think that if the user comes back after 10 s it's ok to just wait for the actual one. What do you think @marcochavezf ?
|
@mkhutornyi kind bump here :) |
heyjennahay
left a comment
There was a problem hiding this comment.
Refactor. Product review not required
|
I was waiting for #82154 (comment) |
Clearing is just a small part of the refactor, one that can be easily removed / updated. Not sure if that should hold the review wdyt ? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f960fcde10
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.PENDING_CONCIERGE_RESPONSE}${reportID}`, | ||
| value: { |
There was a problem hiding this comment.
Preserve all pending Concierge replies per report
addOptimisticConciergeActionWithDelay() writes the delayed response with Onyx.METHOD.SET to a single PENDING_CONCIERGE_RESPONSE_<reportID> entry, so a second suggested-followup selected in the same report before the first 4s delay expires will overwrite the first pending action. In that case the hook can only apply the latest item, and the earlier optimistic Concierge reply is dropped instead of being shown, which is a user-visible regression when multiple unresolved followups are tapped in quick succession.
Useful? React with 👍 / 👎.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-02-20.at.4.13.38.pm.mov |
|
Please check bot reviews above |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #81749 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
I don't think there's anything here for @heyjennahay needs to review, so I'm going to go ahead and merge it. |
|
🚧 @deetergp has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/deetergp in version: 9.3.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.25-13 🚀
|
Explanation of Change
This PR refactors the way in which delayed response is processed in the app to make it more suitable for longer timeouts. It increases the response time to 4 seconds as well.
[No QA] added because this is just a refactor.
Fixed Issues
$ #81749
PROPOSAL:
Tests
Expected
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-02-13.at.19.22.38.mov