Fix : Reports - Create report button does not show upgrade page when account has no workspace#78995
Fix : Reports - Create report button does not show upgrade page when account has no workspace#78995M00rish wants to merge 20 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@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] |
|
|
||
| const description = useMemo(() => { | ||
| if (isCategorizing ?? isReporting) { | ||
| if (isCategorizing || isReporting) { |
There was a problem hiding this comment.
❌ CONSISTENCY-2
The ?? operator was likely intentional for null/undefined checking, but || treats falsy values differently (including false, 0, ""). If isCategorizing or isReporting are explicitly false, this will incorrectly fall through to the condition.
Suggested fix: Keep the nullish coalescing operator if the intent was to only check for null/undefined:
if (isCategorizing ?? isReporting) {Or if you intended OR logic, use explicit checks:
if (isCategorizing || isReporting) {Note: This appears to be a logical change rather than just a style fix - ensure the new behavior is correct.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db5cf3efa9
ℹ️ 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".
| policy: newPolicy, | ||
| reportNextStep, | ||
| policyCategories: allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`], | ||
| allTransactions, | ||
| }); |
There was a problem hiding this comment.
Pass selected transactions data to bulk move
In this upgrade flow you pass allTransactions from the Onyx TRANSACTION collection into changeTransactionsReport, but the selected items here come from SearchContext (snapshot search results) and aren’t guaranteed to exist in that Onyx collection. changeTransactionsReport filters missing entries and returns early when none are found, so the post-upgrade bulk move can become a no-op for search-based selections. Consider building the allTransactions map from selectedTransactions (as the search change-report flow does) or otherwise ensuring the selected IDs are present before calling.
Useful? React with 👍 / 👎.
|
@M00rish Please fix errors |
|
Done @shubham1206agra |
|
I'll take this up for review based on Slack |
|
@JmillsExpensify On staging, it says "Collect" plan before upgrading, and "Control" plan after it's done. Is it a bug? Screen.Recording.2026-02-10.at.1.44.03.AM.mov |
| const expenseReportID = policyDataRef.current?.expenseChatReportID ?? reportID; | ||
| const policyID = policyDataRef.current?.policyID; | ||
|
|
||
| if (upgradePath === CONST.UPGRADE_PATHS.REPORTS && policyID && selectedTransactionsKeys.length > 0) { |
There was a problem hiding this comment.
But this can be true for actions other than move-expenses also?
There was a problem hiding this comment.
Export, Merge, and Delete never navigate to STEP_UPGRADE.
| if (upgradePath === CONST.UPGRADE_PATHS.REPORTS && policyID && selectedTransactionsKeys.length > 0) { | ||
| const newPolicy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`]; | ||
|
|
||
| const optimisticReport = createNewReport(currentUserPersonalDetails, hasViolations, isASAPSubmitBetaEnabled, newPolicy, betas); |
There was a problem hiding this comment.
Shouldn't we use selectedReport?.ownerAccountID ? See how it's done in IOURequestEditReport.
There was a problem hiding this comment.
yes thanks for the catch.
| const navigateWithMicrotask = useCallback( | ||
| (route: Route) => { | ||
| if (isWeb) { | ||
| Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.navigate(route)); | ||
| } else { | ||
| Navigation.navigate(route); | ||
| } | ||
| }, | ||
| [isWeb], | ||
| ); |
There was a problem hiding this comment.
Why has this been changed?
| const expenseReportID = policyDataRef.current?.expenseChatReportID ?? reportID; | ||
| const policyID = policyDataRef.current?.policyID; | ||
|
|
||
| if (upgradePath === CONST.UPGRADE_PATHS.REPORTS && policyID && selectedTransactionsKeys.length > 0) { |
There was a problem hiding this comment.
Also, why not handle this via switch inside CONST.UPGRADE_PATHS.REPORTS ?
There was a problem hiding this comment.
that would complicate things and require a rewrite of the function especially with Navigation.goBack()
There was a problem hiding this comment.
Bug and the reason: Bulk-move can run for unrelated upgrade flows due to shared SearchContext state. If selectedTransactions remains populated (for example user entered upgrade from Search, backed out, then went to a normal submit-upgrade flow), this will move the older selected expenses.
See how the first expense got moved even though we did it for the second expense individually.
Screen.Recording.2026-02-15.at.10.43.15.PM.mov
Screencast.from.2026-02-18.00-31-35.webmfixed @ShridharGoel |
|
Shouldn't the upgrade page open directly after clicking "Move expenses" and before the "Create report" option shows? Similar to how it works when we click on the reports row in expense details |
|
@heyjennahay Can you confirm the expected behaviour? |
|
This was discussed and decided here: #77040 (review) |
|
will check that today. |
|
Sorry for the delay will have an update today *or tomorow |
# Conflicts: # src/pages/iou/request/step/IOURequestStepUpgrade.tsx
looks good on my end @ShridharGoel |
|
Can you merge main here? |
Did you try with offline mode? |


Explanation of Change
Fixed Issues
$ #73762
PROPOSAL:
comment
Tests
Precondition: Account has self DM and no workspace
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Android: Native
Android.webm
Android: mWeb Chrome
AndroidWeb.webm
iOS: Native
ios.webm
iOS: mWeb Safari
iosWeb.webm
MacOS: Chrome / Safari
web.webm