Skip to content

Fix member import crash and missing navigation after confirmation#84799

Merged
stitesExpensify merged 5 commits intomainfrom
claude-fixImportMembersCrashAndNavigation
Mar 11, 2026
Merged

Fix member import crash and missing navigation after confirmation#84799
stitesExpensify merged 5 commits intomainfrom
claude-fixImportMembersCrashAndNavigation

Conversation

@MelvinBot
Copy link
Contributor

Explanation of Change

This PR fixes two issues with the workspace members import from spreadsheet flow:

1. App crash (React error #185 — Maximum update depth exceeded):
showModal and closeModal in ModalProvider were not memoized, causing new function references on every re-render. Since showConfirmModal (which derives from showModal) was in the useEffect dependency array of ImportSpreadsheetConfirmModal, each call to showConfirmModal triggered a state update → re-render → new function reference → effect re-fires → infinite loop. Fix: wrap both functions with useCallback and memoize the context value with useMemo. Additionally, pass a stable id to showConfirmModal so the existing deduplication logic in ModalProvider prevents duplicate modals as a defense-in-depth measure.

2. No navigation after pressing "Got it" on success modal:
ImportedMembersPage and ImportedMembersConfirmationPage placed navigation logic in the onModalHide callback, but ConfirmModalWrapper overrides onModalHide with its own handler, silently dropping the navigation callback. This left users stuck on the import page after a successful import. Fix: move Navigation.goBack() directly into closeImportPageAndModal, matching the pattern used by all other import pages (categories, tags, per diem).

Fixed Issues

$ #84489
PROPOSAL: #84489 (comment)

Tests

  1. Sign in and create a workspace
  2. Navigate to Workspace > Members > More > Import spreadsheet
  3. Upload a CSV file containing email addresses
  4. Map the email column and click Import
  5. Verify the success modal ("Import successful") appears without the app crashing
  6. Click "Got it"
  7. Verify navigation goes back to the Members list (not stuck on the import page)
  8. Verify the imported members are visible in the Members list
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline before clicking Import in step 4
  2. Verify the Import button is disabled while offline
  3. Go back online and retry the import
  4. Verify the flow completes successfully

QA Steps

  1. Sign in with a test account
  2. Create a workspace (or use an existing one)
  3. Navigate to Workspace > Members > More > Import spreadsheet
  4. Upload a CSV with member emails (at least 2-3 rows)
  5. Map the email column and click Import
  6. Verify the "Import successful" modal appears without any crash
  7. Click "Got it"
  8. Verify you are navigated back to the Members list
  9. Verify imported members appear in the list
  10. Repeat steps 3-9 but with a CSV that includes a Role column where some roles are missing — this should navigate to the Confirm details page first, then show the success modal after import, and navigate back to Members after clicking "Got it"
  • Verify that no errors appear in the JS console

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 followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Web: Chrome

Import spreadsheet screen:
Import spreadsheet upload screen

Column mapping screen:
Column mapping screen

Import success modal (no crash):
Import successful confirmation modal

Members list after clicking "Got it" (navigation works):
Members list after import

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Memoize showModal/closeModal in ModalProvider to prevent infinite
re-render loop, add stable modal id for deduplication, and move
navigation into closeImportPageAndModal to match other import pages.

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team March 10, 2026 21:28
@MelvinBot
Copy link
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-fixImportMembersCrashAndNavigation
git checkout -b claude-fixImportMembersCrashAndNavigation upstream/claude-fixImportMembersCrashAndNavigation
git push -u origin claude-fixImportMembersCrashAndNavigation

Then you can close this PR and open a new one from your fork.

…embersConfirmationPage

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
Copy link
Contributor Author

Fixed the failing Changed files ESLint check: Added missing sentryLabel prop to the PressableWithoutFeedback component in ImportedMembersConfirmationPage.tsx. The ESLint rule requires all Pressable components to include a sentryLabel for Sentry tracking.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/index.ts 93.54% <ø> (ø)
src/components/ImportSpreadsheetConfirmModal.tsx 0.00% <ø> (ø)
src/components/Modal/Global/ModalContext.tsx 84.21% <100.00%> (+0.87%) ⬆️
src/hooks/useConfirmModal.ts 100.00% <100.00%> (ø)
...kspace/members/ImportedMembersConfirmationPage.tsx 0.00% <0.00%> (ø)
... and 129 files with indirect coverage changes

@ZhenjaHorbach
Copy link
Contributor

@MelvinBot
You can open this PR

@MelvinBot MelvinBot marked this pull request as ready for review March 11, 2026 09:01
@MelvinBot MelvinBot requested a review from a team as a code owner March 11, 2026 09:01
@MelvinBot
Copy link
Contributor Author

PR has been marked as ready for review. 🚀

@melvin-bot melvin-bot bot requested review from ZhenjaHorbach and removed request for a team March 11, 2026 09:01
@melvin-bot
Copy link

melvin-bot bot commented Mar 11, 2026

@ZhenjaHorbach 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 heyjennahay and removed request for a team March 11, 2026 09:01
const modalPromisesStack = useRef<Record<string, CloseModalPromiseWithResolvers>>({});

const showModal: ModalContextType['showModal'] = ({component, props, id, isCloseable = true}) => {
const showModal: ModalContextType['showModal'] = useCallback(({component, props, id, isCloseable = true}) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ CLEAN-REACT-PATTERNS-0 (docs)

React Compiler is enabled in this codebase and automatically memoizes closures based on their captured variables. The useCallback wrapping showModal (line 45), useCallback wrapping closeModal (line 68), and useMemo for contextValue (line 91) are manual memoization that the compiler should handle.

The functions only reference stable values: setModalStack (state setter), modalPromisesStack (ref), modalIDRef (ref), and module-level imports (Log, CONST). With enableTreatRefLikeIdentifiersAsRefs: true in the babel config, the compiler will produce stable references for these functions automatically.

Remove useCallback from both showModal and closeModal, remove the useMemo wrapper from contextValue, and pass {{showModal, closeModal}} directly to the Provider. If the compiler cannot handle this file for some reason, add a // eslint-disable-next-line react-compiler/react-compiler comment explaining why manual memoization is needed.


Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ZhenjaHorbach what is your take on this?

Copy link
Contributor

@ZhenjaHorbach ZhenjaHorbach Mar 11, 2026

Choose a reason for hiding this comment

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

This proposal contradicts the fix that fixes the crash because of causing new function references on every re-render without memoization

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Mar 11, 2026

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 any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Android: HybridApp
2026-03-11.13.53.19.mov
Android: mWeb Chrome
2026-03-11.13.51.58.mov
iOS: HybridApp
2026-03-11.13.53.19.mov
iOS: mWeb Safari
2026-03-11.13.51.58.mov
MacOS: Chrome / Safari
2026-03-11.13.48.56.mov

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Mar 11, 2026

@MelvinBot
I suppose after successfully adding new members, we need to close the confirm details screen but show the import successful modal

…rtedMembersPage

When importing members with missing roles, the confirmation page now
navigates back when the import succeeds, letting ImportedMembersPage's
existing ImportSpreadsheetConfirmModal (which has an isFocused guard)
display the success modal. This matches the reviewer's expectation that
the confirm details screen closes while the modal remains visible.

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner March 11, 2026 12:00
@MelvinBot
Copy link
Contributor Author

Good point! I've updated the confirmation page so that when the import succeeds (shouldFinalModalBeOpened becomes true), it navigates back immediately instead of showing the modal itself. The ImportedMembersPage already has its own ImportSpreadsheetConfirmModal with an isFocused guard, so it picks up the success modal when it regains focus. After the user dismisses the modal there, closeImportPageAndModal on ImportedMembersPage handles the final navigation to the members list.

Changes in 6d98c1c:

  • Removed ImportSpreadsheetConfirmModal from ImportedMembersConfirmationPage
  • Added a useEffect that calls Navigation.goBack() when import succeeds
  • Removed the now-unused closeImportPageAndModal, useCloseImportPage, and related imports

@melvin-bot melvin-bot bot requested a review from stitesExpensify March 11, 2026 12:01
@melvin-bot
Copy link

melvin-bot bot commented Mar 11, 2026

@stitesExpensify 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 removed the request for review from a team March 11, 2026 12:01
@ZhenjaHorbach
Copy link
Contributor

@MelvinBot
But no
Let's revert the last changes to make consistency between other screens

But we need to fix a bug where, after successfully adding members, the confirm details screen resets the added users
And after pressing, got it, confirm the details screen is closed, but the successful modal reopens( the successful modal shouldn't reopen again)

Снимок экрана 2026-03-11 в 13 14 52

Reverts the approach of delegating the success modal to ImportedMembersPage.
Instead, keeps ImportSpreadsheetConfirmModal on ImportedMembersConfirmationPage
for consistency with other import screens (categories, tags, per diem).

Fixes:
- Navigation after "Got it": moves Navigation.goBack() into
  closeImportPageAndModal (the onModalHide callback is overridden by
  ConfirmModalWrapper so it never fires).
- Modal reopening: calls closeImportPage() in closeImportPageAndModal to
  immediately clear shouldFinalModalBeOpened before navigating, preventing
  ImportedMembersPage's modal from firing during the transition.
- Data reset behind modal: freezes the displayed member list once import
  starts using a ref, so the UI doesn't flash empty data when the policy
  updates with the newly imported members.

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
Copy link
Contributor Author

Reverted the last commit and fixed the bugs. Here's what changed in 5efabaa:

Reverted: The ImportSpreadsheetConfirmModal is back on ImportedMembersConfirmationPage (matching the pattern used by categories, tags, and per diem import pages). ImportedMembersPage is restored to its original state.

Fixed — Navigation after "Got it": Moved Navigation.goBack(ROUTES.WORKSPACE_MEMBERS.getRoute(policyID)) directly into closeImportPageAndModal instead of relying on the onModalHide callback (which ConfirmModalWrapper overrides, so it never fires).

Fixed — Modal reopening: closeImportPageAndModal now calls closeImportPage() to immediately clear shouldFinalModalBeOpened in Onyx before navigating. This prevents ImportedMembersPage's modal from firing during the navigation transition back to the members list.

Fixed — Data reset behind modal: When the import API succeeds, the policy's employee list updates, causing newMembers to recalculate as empty (imported members are now policy members). This made the confirm details screen flash empty data behind the modal. Fix: freeze the displayed member list using a ref once isImporting becomes true, so the UI stays stable while the success modal is shown.

@ZhenjaHorbach
Copy link
Contributor

@MelvinBot
Modal is still reopening after closing the confirm details screen

Снимок экрана 2026-03-11 в 13 40 32

@MelvinBot
Copy link
Contributor Author

The failing check is test (job 8) — specifically tests/ui/SessionTest.tsx with two Deep linking tests timing out. This is unrelated to this PR.

Analysis: The PR changes ModalContext.tsx (memoization), useConfirmModal.ts, ImportSpreadsheetConfirmModal.tsx, and ImportedMembersConfirmationPage.tsx. None of these files are related to deep linking or session management tested in SessionTest.tsx.

Evidence: The same SessionTest.tsx failure is occurring on multiple unrelated branches right now:

  • change-payer-for-share (run 22951619964)
  • claude-adjustTableRowStyles (run 22949966895)

This is a pre-existing flaky test, not caused by this PR's changes. Re-running the test suite should resolve it.

Add shouldShowConfirmModal and isFocused guards to isVisible prop,
matching the pattern used in ImportedMembersPage. Without these
synchronous guards, the async Onyx update to shouldFinalModalBeOpened
creates a window where the useEffect re-fires and reopens the modal.

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
Copy link
Contributor Author

Fixed in 5ee4e23. The modal was reopening because ImportedMembersConfirmationPage lacked the local synchronous guards that ImportedMembersPage already has.

Root cause: When the user presses "Got it", closeImportPageAndModal() calls setIsImporting(false) (sync state update → triggers re-render) and closeImportPage() (async Onyx merge to set shouldFinalModalBeOpened=false). The re-render happens before Onyx propagates the update, so isVisible (spreadsheet?.shouldFinalModalBeOpened) is still true. Meanwhile, the un-memoized closeImportPageAndModal creates a new function reference on re-render, which is in the useEffect dependency array of ImportSpreadsheetConfirmModal — causing the effect to re-fire and call showConfirmModal again, reopening the modal.

Fix: Added shouldShowConfirmModal state and isFocused guard to isVisible in ImportedMembersConfirmationPage, matching the pattern already used in ImportedMembersPage. The setShouldShowConfirmModal(false) call in closeImportPageAndModal is a synchronous state update that takes effect immediately on re-render, preventing the modal from reopening even before Onyx updates.

@ZhenjaHorbach
Copy link
Contributor

LGTM!

Copy link
Contributor

@stitesExpensify stitesExpensify left a comment

Choose a reason for hiding this comment

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

Looking good, one question about the GH action bot post

@stitesExpensify stitesExpensify merged commit c82c37d into main Mar 11, 2026
37 checks passed
@stitesExpensify stitesExpensify deleted the claude-fixImportMembersCrashAndNavigation branch March 11, 2026 15:38
@OSBotify
Copy link
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.

@github-actions
Copy link
Contributor

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/stitesExpensify in version: 9.3.36-0 🚀

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

@roryabraham
Copy link
Contributor

showModal and closeModal in ModalProvider were not memoized, causing new function references on every re-render.

This was not true. ModalProvider was compiled with React Compiler, so wrapping these functions with manual memoization was redundant and unnecessary.

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Mar 12, 2026

showModal and closeModal in ModalProvider were not memoized, causing new function references on every re-render.

This was not true. ModalProvider was compiled with React Compiler, so wrapping these functions with manual memoization was redundant and unnecessary.

Strange
Before, it was a crash without memoization
But now seems like everything is good
But I will check more details

@MelvinBot
Could you create a new PR as a follow-up to this PR to remove memoization for ModalContext?

@MelvinBot
Copy link
Contributor Author

Created follow-up draft PR to remove the redundant manual memoization from ModalProvider: #85035

Since ModalProvider is compiled with React Compiler, the useCallback/useMemo wrappers are unnecessary. The follow-up PR reverts those to plain function declarations and an inline context value.

Please mark it as "Ready for review" when it is ready for review.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.36-10 🚀

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants