Skip to content

[Payment due @ikevin127] [CP stag] Show the support ticket title while creation is pending - #103940

Merged
jasperhuangg merged 19 commits into
mainfrom
codex/691361-support-ticket-title
Oct 14, 2026
Merged

jasperhuangg merged 19 commits into
mainfrom
codex/691361-support-ticket-title

Conversation

@jasperhuangg

@jasperhuangg jasperhuangg commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

  • Show “Support ticket” while a new ticket is being created, so the header and LHN do not fall back to the support rep's name.
  • Give the optimistic report an ID and keep its creation guard in RAM-only loading state, so reloading cannot leave the ticket stuck loading.
  • Release the guard on success, and remove the report and loading state on server or transport failure.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/691361
PROPOSAL:

Tests

Prerequisite: Enable the supportTicket beta for the test account.

Connected network

  1. Go to Settings > Help and select Talk to a human.
  2. While creation is pending, verify the header displays Support ticket instead of a title skeleton or the assigned support rep's name. Any pending LHN entry should also use the support-ticket title.
  3. Let the request finish and verify the full dated support-ticket title and conversation load without a not-found page.
  4. Reopen a resolved ticket and verify it opens the ticket chosen by the server.

Offline steps

  1. Open Settings > Help, turn Wi-Fi / internet off, and select Talk to a human.
  2. While the request is pending, verify the header displays Support ticket. The messages can remain loading until the request completes.
  3. Wait for creation to fail (about 5 seconds). Verify the optimistic LHN entry is removed and the app redirects to Concierge without an error message. Reconnect and verify no support ticket was created.
  4. Repeat using the app's Force offline toggle. This can let the backend create a ticket while the client discards the response. Verify the same redirect to Concierge after the failure. Disable Force offline and synchronize: the server-created ticket should appear in the LHN, while the current chat stays on Concierge. Open the ticket from the LHN and verify it loads.

Reload during creation

  1. With Wi-Fi / internet off, select Talk to a human, then reload within about 2 seconds while the Support ticket header is showing.
  2. Reconnect and verify the report resolves to content if the server created it, or the normal not-found screen if it did not. It must not remain on the loading skeleton, and the URL must lose isPendingCreation=true.
  3. Repeat with Force offline, then disable the toggle after reloading. If the server created the ticket, verify its conversation loads on the restored URL.

QA Steps

Repeat the connected-network, offline, and reload steps above on staging with the supportTicket beta enabled.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected in all cases)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Not included. This fixes a brief pending-state race and does not change the final UI.

AI Tests

  • SupportTicketTest, ReportFetchHandlerTest, and ReportNameUtilsTest: 134 tests passed.
  • Regression tests cover pending fetch suppression online/offline, releasing the pending route on success, optimistic cleanup on server/transport failures, and the fallback support-ticket title.
  • Typecheck, lint-changed, spell-changed, React Compiler compliance, and Oxfmt checks passed.
  • Local web UI verified: pending header and LHN title, successful creation, Force offline cleanup, simulated failed-response cleanup and subsequent recovery, and reopening with server-selected reassignment.
  • Browser logs confirmed no OpenReport request before creation completes. Added a regression test proving the optimistic flag is observable before the report ID; it failed before the ordering fix and passes afterward.
  • Testing preferences were restored afterward. Physical Wi-Fi disconnection and native mobile were not tested.
  • Console output included existing React/Reanimated warnings and transient Pusher authorization failures before the report exists; the tested tickets loaded successfully.

@jasperhuangg
jasperhuangg requested review from a team as code owners October 13, 2026 20:38
@melvin-bot
melvin-bot Bot requested review from ikevin127 and removed request for a team October 13, 2026 20:38
@melvin-bot

melvin-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

@ikevin127 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]

@melvin-bot
melvin-bot Bot requested review from garrettmknight and removed request for a team October 13, 2026 20:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T20:51:04.066592Z b0ce551 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread src/libs/actions/Report/index.ts Resolved
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/actions/Report/index.ts 73.01% <100.00%> (+1.20%) ⬆️
src/pages/inbox/ReportFetchHandler.tsx 91.01% <100.00%> (+0.03%) ⬆️
... and 332 files with indirect coverage changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0ce55196f

ℹ️ 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".

Comment thread src/libs/actions/Report/index.ts Resolved
Comment thread src/libs/actions/Report/index.ts Resolved
@jasperhuangg jasperhuangg changed the title fix: show the support ticket title while creation is pending Show the support ticket title while creation is pending Oct 13, 2026
@ikevin127

This comment has been minimized.

@jasperhuangg

Copy link
Copy Markdown
Contributor Author

(Jasper's Agent) The unrelated Jest failure is already tracked in App issue 103714 and fixed by App PR 103747. It passes in isolation on the refreshed branch, so no change is needed here. Failed run: test job 7.

@jasperhuangg

Copy link
Copy Markdown
Contributor Author

@ikevin127 yep! sorry it should be ready for review now. Please remind me to create an App issue for review payment once this is done

@ikevin127

ikevin127 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Online WiFi OFF Force offline ON
online.mov
wifi-off.mov
force-offline-concierge.mov

Comment thread src/libs/actions/Report/index.ts Resolved
Comment thread src/libs/actions/Report/index.ts Resolved
Comment thread src/libs/actions/Report/index.ts Resolved
Comment thread tests/actions/SupportTicketTest.ts Resolved
Comment thread src/pages/inbox/ReportFetchHandler.tsx Outdated
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportOnyx?.chatReportID}`);
const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`);
const [reportLoadingState = defaultReportLoadingState] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${reportIDFromRoute}`);
const isPendingReportCreation = !!reportMetadata.isOptimisticReport || !!reportLoadingState.isCreatingSupportTicket;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 src/pages/inbox/ReportFetchHandler.tsx:133

Now that the guard lives in RAM_ONLY_REPORT_LOADING_STATE, nothing sets reportMetadata.isOptimisticReport for a pending-creation route. Support tickets are the only caller of isPendingCreation, and they don't write REPORT_METADATA anymore.

Keeping it in isPendingReportCreation brings back the persisted guard we just moved away from. If any flow ever pairs isPendingCreation with a persisted isOptimisticReport: true, the reload bug comes back. Could we drop it ?

const isPendingReportCreation = !!reportLoadingState.isCreatingSupportTicket;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah makes sense, fixing this

@ikevin127 ikevin127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 LGTM - Thanks for addressing the comments!

🟢 Drop reportMetadata.isOptimisticReport from isPendingReportCreation. Approving, but it's a one-line cleanup that closes off the reload bug for good.

@melvin-bot
melvin-bot Bot requested a review from lakchote October 14, 2026 22:49
@melvin-bot

melvin-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

@lakchote 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]

@melvin-bot melvin-bot Bot changed the title Show the support ticket title while creation is pending [Payment due @ikevin127] Show the support ticket title while creation is pending Oct 14, 2026
@melvin-bot

melvin-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

🎯 @ikevin127, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/691361.

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.

@chiragsalian chiragsalian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasperhuangg jasperhuangg changed the title [Payment due @ikevin127] Show the support ticket title while creation is pending [Payment due @ikevin127] [CP stag] Show the support ticket title while creation is pending Oct 14, 2026
@jasperhuangg
jasperhuangg merged commit 1fde4bc into main Oct 14, 2026
41 checks passed
@jasperhuangg
jasperhuangg deleted the codex/691361-support-ticket-title branch October 14, 2026 23:20
@github-actions

Copy link
Copy Markdown
Contributor

🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here.

OSBotify pushed a commit that referenced this pull request Oct 14, 2026
…-title

[Payment due @ikevin127] [CP stag] Show the support ticket title while creation is pending

(cherry picked from commit 1fde4bc)

(cherry-picked to staging by jasperhuangg)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Oct 14, 2026
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 9.5.9-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update is needed. This PR fixes a loading-state bug in support ticket creation, which is still behind the supportTicket beta, and no existing article describes the pending ticket title.


view run

@kavimuru

Copy link
Copy Markdown

@jasperhuangg

  1. Go to Settings > Help and select Talk to a human.
  1. While creation is pending, verify the header displays Support ticket instead of a title skeleton or the assigned support rep's name. Any pending LHN entry should also use the support-ticket title.
  2. Let the request finish and verify the full dated support-ticket title and conversation load without a not-found page.
  3. Reopen a resolved ticket and verify it opens the ticket chosen by the server.

Can you help with steps 2 to 4?

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.9-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #104120

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 9.5.10-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update is needed. This PR fixes a loading-state bug in support ticket creation, which is still behind the supportTicket beta, and no existing article describes the pending ticket title.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 9.5.12-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update is needed. This PR fixes the title shown while a support ticket is being created, and the Talk to a human entry point is still behind the supportTicket beta (HelpPage.tsx:215).


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.12-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants