Repository navigation
Fix Concierge skeleton flash on main DM refresh - #92980
Conversation
…eleton Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
@MelvinBot The skeleton fix looks correct, but there's a gap: the Investigate this scenario and apply the changes if required. |
|
There's no code-level failure to fix here — every automated check passes. The only failing check is All code-correctness checks are green: The |
… on refresh The startSession gates were still keyed on the RAM-only hasOnceLoadedReportActions, so on refresh sessionStartTime stayed null until openReport returned. During that window filterActions collapses the cached history to just the synthetic CREATED action. Gate session start on cached actions too, matching the skeleton-suppression gate, so messages render immediately on refresh. Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Confirmed — the gap is real, and I've pushed a fix. Root cause: After the skeleton is suppressed on refresh, Fix: Gate session start on cached actions too, matching the skeleton-suppression gate. Introduced Why this is safe
Verification: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2259f5085
ℹ️ 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".
| // just the synthetic CREATED action (an almost-empty chat flash). Start the | ||
| // session as soon as cached actions exist so messages render immediately on | ||
| // refresh, matching the skeleton-suppression gate below. | ||
| const canStartConciergeSession = hasOnceLoadedReportActions || allReportActions.length > 0; |
There was a problem hiding this comment.
Avoid starting Concierge sessions before unread boundary loads
When refreshing an unread Concierge main DM with any cached action but before openReport has populated oldestUnreadReportAction, this makes canStartConciergeSession true and the layout effect calls startSession(undefined). ConciergeSessionProvider.startSession then stores the current time and ignores later calls while the session is unexpired, so when the unread boundary arrives the session cannot be corrected to report.lastReadTime; unread messages created before the refresh time can remain hidden behind the welcome/previous-history filtering instead of being shown.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid point — but this only affects the narrow case where the Concierge DM is unread AND the oldest unread action isn't in the cached page (uncommon since the user was already viewing it). The messages are still recoverable via "Show previous messages." Accepting this trade-off for the deploy blocker fix; the alternative is the skeleton flash we're fixing. Can address as a follow-up if needed.
@MelvinBot can you also investigate this.
PR Author Checklist
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMonosnap.screencast.2026-06-09.05-12-27.mp4 |
|
Investigated — your characterization is accurate. The narrow regression is real, scoped exactly as you described, and recoverable. Mechanism: In the unread case, the early Why it's narrow + recoverable:
Agreed this is an acceptable trade-off vs. the skeleton flash for the deploy blocker. Optional follow-up to eliminate even this narrow caseGate the early start so it doesn't fire while the unread boundary is still unknown — e.g. skip the cached-actions early-start when the report is unread but I did not push any code change for this, per your call to accept the trade-off now. |
|
|
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Fixed the failing ESLint check. The error was in the PR's own file — I did not swap -const canStartConciergeSession = hasOnceLoadedReportActions || allReportActions.length > 0;
+const canStartConciergeSession = !!hasOnceLoadedReportActions || allReportActions.length > 0;This matches the existing Note: the |
…tonOnRefresh Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Fixed the failing Root cause: The branch was stale (33 commits behind Fix: The remaining |
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
This comment was marked as off-topic.
This comment was marked as off-topic.
c2ed7aa to
e82ef3d
Compare
|
@Krishna2323 I'm moving this forward, I believe the CI checks are unrelated |
|
@shubham1206agra 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] |
|
Expecting failures:
|
|
@Julesssss looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Expected emergency: #92980 (comment) |
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
…fresh Fix Concierge skeleton flash on main DM refresh (cherry picked from commit f3d563e) (cherry-picked to staging by Julesssss)
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
|
The failing ESLint check is not caused by this PR — it's a pre-existing Why it's unrelated This PR only changes
Both files and their seatbelt entries are byte-identical to current Other open PRs still pass ESLint only because they haven't merged the recent What needs to happen This belongs in a separate change against The only other failing check is |
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.0-7 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This change only affects internal loading behavior of the Concierge main DM — it suppresses a skeleton/empty-chat flash on page refresh by starting the Concierge session from cached report actions instead of waiting for There is no new or changed user-facing feature, setting, tab, button, or workflow to document. The help site articles under @Krishna2323, let me know if you believe a specific help article is affected and I'll revisit. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.1-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This PR is an internal rendering bug fix — it prevents a Concierge main-DM skeleton/empty-chat flash on page refresh by starting the Concierge session from cached report actions. It changes only component logic (
I also searched Because no docs changes are needed, I did not create a draft help site PR. @Krishna2323, no linked help site PR was created since no documentation updates are required. If you believe a customer-facing behavior here should be documented, reply with details and I'll draft the changes. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.1-6 🚀
|
Explanation of Change
PR #88769 ("Hide read Concierge history in main DM chat") extended the Concierge skeleton-loader gate from the side panel to the main DM by switching the condition from
isConciergeSidePaneltoisConciergeHiddenHistory. The skeleton now shows whenever!hasOnceLoadedReportActions.hasOnceLoadedReportActionslives inreportLoadingState, which is registered RAM-only, so it resets toundefinedon a page refresh and stays falsy until theopenReportresponse returns. During that window the main Concierge DM rendered the skeleton even though report actions were already cached in Onyx — producing a visible skeleton flash on every refresh (staging-only, since production never had this gate on the main DM).This change keeps the side-panel behavior unchanged (it always opens fresh, so it still gates purely on
hasOnceLoadedReportActions), but for the main DM it suppresses the skeleton when cached report actions already exist. The check usesallReportActionsrather thanreportActions, becauseuseReportActionsPaginationalways injects a syntheticCREATEDaction for Concierge chats — soallReportActionsis empty only on a genuinely cold load with no cached history. On a cold load the skeleton still shows (preserving the welcome-state vs. history decision the original PR added); on refresh the cached history renders immediately, matching production.ReportActionsView.tsx:184Fixed Issues
$ #92936
PROPOSAL: #92936 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
openReportresolvesOffline tests
Same as Tests.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
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
MacOS: Chrome / Safari