[Payment due @ChavdaSachin] Fix suggested followup ordering and add HTML formatting tests#86382
Conversation
The optimistic Concierge response was using createdOffset: 1 (1ms), which was not sufficient to guarantee correct sort order when both the user's comment and Concierge response are queued to Onyx near-simultaneously. Using CONCIERGE_RESPONSE_DELAY_MS (4s) ensures the Concierge response timestamp is well after the user's comment. Also adds tests verifying: - HTML formatting (bullets, breaks, strong tags) is preserved in followup-response parsing - Concierge response timestamp is strictly after user comment Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@ChavdaSachin 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| text: selectedFollowup.response, | ||
| actorAccountID: CONST.ACCOUNT_ID.CONCIERGE, | ||
| createdOffset: 1, | ||
| createdOffset: CONCIERGE_RESPONSE_DELAY_MS, |
There was a problem hiding this comment.
In reality, any value ≥1000ms would work, but using this one since it's the delay we use to post the optimistic Concierge response
| ]); | ||
| }); | ||
|
|
||
| it('should preserve HTML formatting in followup-response (bullets, breaks, strong tags)', () => { |
There was a problem hiding this comment.
This one is not related to the main change, but it's a regression coverage for the HTML preservation
|
Ok this is now ready for review @ChavdaSachin |
|
Friendly bump @ChavdaSachin |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-03-31.at.11.34.21.PM.mov |
|
@mjasikowski 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] |
|
🎯 @ChavdaSachin, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
🚧 @mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.3.52-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against the help site articles under No help site changes are required. This PR is a purely internal bug fix — it changes the
The existing Concierge help articles ( |
Explanation of Change
When a user clicks a suggested followup button with a pregenerated response, the optimistic Concierge reply briefly renders above the user's question. This happens because the Concierge response's
createdtimestamp usescreatedOffset: 1(1ms), which is not enough to guarantee correct sort order when both actions are queued to Onyx near-simultaneously.Fix: Changed
createdOffsetfrom1toCONCIERGE_RESPONSE_DELAY_MS(4000ms). This ensures the Concierge response timestamp is well after the user's comment, matching the visual delay where Concierge "types" for 4 seconds before showing the response.Also adds test coverage verifying:
createdtimestamp is strictly after the user comment's timestamp<followup-response>parsing is preserved (existingrender()fix validated)Note: This PR fixes the ordering of followup responses. Bullet-point formatting in Concierge responses is fixed separately in Auth#19993.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/616314
Tests
Pre-requisites: Use an account with the excluded beta
suggestedFollowups. You can use an account with the domain@dmb.funthat has access to the beta.Test Evidence
should preserve HTML formatting in followup-response— PASS (verifiesrender()preserves<br>,<ul>,<li>,<strong>tags)should create Concierge response with timestamp strictly after the user comment— PASS (verifiescreatedOffset: CONCIERGE_RESPONSE_DELAY_MSproduces correct ordering)Offline tests
N/A — followup buttons only appear in online Concierge conversations.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-03-26.at.10.04.00.p.m.mov