Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.2.43-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #72871
Email or phone of affected tester (no customers): duytestnguyen+63@gmail.com
Issue reported by: Applause Internal Team
Device used: Android 16 / Pixel 7A
App Component: Workspace Settings
Action Performed:
Preconditions:
- [User A] Create new account (A)
- [User B] User have a workspace (Workspace 1) and add user A to Workspace 1 as member
- All steps below are run by User A
- Open Hybrid app
- Navigate to Account > Troubleshoot
- Clear cached and restart
- Navigate to Workspace
- Create new Workspace (Workspace 2)
- Leave Workspace 1
- Delete Workspace 2
- Create new Workspace (Workspace 3)
- Tap on Member > Invite member
- Enter an email > Next
- Tap outside keyboard
Try repeat Step 9, 10 and 11 for twice to three times to experience a crash.
Expected Result:
User can successfully invite member to Workspace
Actual Result:
At step 10 and step 11, app crashes. Try repeat Step 9, 10 and 11 for twice to three times.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Bug6993369_1762234036134!logs-2025-11-04_05_12_16.793.txt
Bug6993369_1762234036144.App_Crash_When_Add_New_Member.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021985885561039373168
- Upwork Job ID: 1985885561039373168
- Last Price Increase: 2026-02-11
- Automatic offers:
- situchan | Contributor | 109439694
Issue Owner
Current Issue Owner: @marufsharifiMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Nov 4, 2025
Triggered auto assignment to @brianlee-expensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.mitarachim commentedon Nov 4, 2025
Issue was found while executing QA for PR #72871
luacmartins commentedon Nov 4, 2025
@mitarachim is this a deploy blocker? It seems like it's not reproducible in production, right?
luacmartins commentedon Nov 4, 2025
This seems like something users won't do, so I won't block the deploy on it.
[-]Android-App crash when invite new member to Workspace[/-][+][$250] Android-App crash when invite new member to Workspace[/+]melvin-bot commentedon Nov 5, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021985885561039373168
melvin-bot commentedon Nov 5, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)IjaazA commentedon Nov 5, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Android app crashes when inviting a new member to a Workspace.
What is the root cause of that problem?
This occurs when navigating between WorkspaceInvitePage and WorkspaceInviteMessageComponent—particularly after sending an initial invitation and attempting to invite another member.
The crash is caused by asynchronous operations and state updates that continue to execute after the component has unmounted, leading to “state update on unmounted component” errors and inconsistent draft restoration on remount.
Missing cleanup for async operations:
searchInServer() in WorkspaceInvitePage lacked cleanup logic.
Pending requests completed after unmount, triggering state updates on unmounted components.
Location: src/pages/workspace/WorkspaceInvitePage.tsx:308–310
State updates after unmount:
The large useEffect block (lines 125–203) could update state after the component was unmounted.
Onyx subscriptions continued updating even after navigation.
No mount guards were used to prevent these updates.
In WorkspaceInviteMessageComponent, a useEffect (lines 111–128) navigated back when the draft was empty.
This logic could re-trigger on remount, causing duplicate navigation events.
firstRenderRef was not reset on remount.
When inviting a second member, the draft state was not restored correctly.
What changes do you think we should make in order to solve the problem?
Code Changes:
File 1: src/pages/workspace/WorkspaceInvitePage.tsx
Change 1: Add mount tracking ref
// Line 60: Add after firstRenderRef
const isMountedRef = useRef(true);Change 2: Reset refs and add cleanup on mount
// Lines 72-85: Update mount useEffect
Change 3: Guard state updates in large useEffect
// Lines 115-193: Update large useEffect
Change 4: Add cleanup for search requests
// Lines 321-329: Update searchInServer useEffect
File 2: src/pages/workspace/members/WorkspaceInviteMessageComponent.tsx
Change 1: Add mount and navigation tracking refs
// Lines 73-74: Add after welcomeNote state
Change 2: Initialize and cleanup refs
// Lines 112-119: Add new useEffect after getDefaultWelcomeNote
Change 3: Fix navigation logic with guards
// Lines 121-143: Update navigation useEffect
What alternative solutions did you explore? (Optional)
Use AbortController for per-request cancellation
132 remaining items
marufsharifi commentedon Mar 17, 2026
@brianlee-expensify, the automation failed for this issue. Could you please process the payment for this issue? since it was deployed to production last week. thanks.
marufsharifi commentedon Mar 23, 2026
@brianlee-expensify, gentle bump. thanks.
melvin-bot commentedon Mar 24, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Mar 24, 2026
Payment Summary
Contributor: @marufsharifi paid $250 via Upwork
Contributor+: @situchan paid $250 via Upwork
@marufsharifi @situchan can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022036551178480319333
marufsharifi commentedon Mar 25, 2026
@mallenexpensify, I've accepted the offer. Thanks.
mallenexpensify commentedon Mar 26, 2026
@marufsharifi paid, summary updated above. Thx.
situchan commentedon Mar 30, 2026
@mallenexpensify I haven't received payment
mallenexpensify commentedon Apr 2, 2026
Apologies @situchan , paid, summary updated above. Thx.