You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-12-03] [$250] The send attachment modal is not closed when admin changes who can post to Admins only #73833
Version Number: 9.2.41-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://github.com/Expensify/Expensify/issues/530095 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Device used: Windows 10 - Chrome App Component: Other
Action Performed:
Launch Expensify.
As User A, create a new chat room.
As User A, invite user B to the chat room that was created in step 2.
As User B, open the chat room and add an attachment, but do not send the attachment at the final step.
As User A, change the Who can post setting for the chat room to Only admins.
As User B, check the send attachment modal
Expected Result:
The send attachment modal is closed, and that the app returns to the chat room.
Actual Result:
The send attachment modal is not closed, and that the app doesn't return to the chat room
Please re-state the problem that we are trying to solve in this issue.
The send attachment modal is not closed when admin changes who can post to Admins only
What is the root cause of that problem?
Currently we don't have any logic that closes the modal when user change the permission to admins only.
What changes do you think we should make in order to solve the problem?
We can track previous isAdminsOnlyPostingRoom state with usePrevious hook and detect the permission change(All members -> admins only) and then dismiss the modal when a non-admin loses posting permission.
Please re-state the problem that we are trying to solve in this issue.
The send attachment modal is not closed when admin changes who can post to Admins only
What is the root cause of that problem?
The ReportAddAttachmentModalContent component does not have any logic to close the modal when write permissions are changed.
The add-attachment view is now a dedicated route (REPORT_ADD_ATTACHMENT), not a child of the composer. When “Who can post” changes, the composer unmounts, but this route stays mounted. So BaseModal’s unmount path never runs.
Worked before as mentioned here but now REPORT_ADD_ATTACHMENT is a dedicated route.
What changes do you think we should make in order to solve the problem?
Add a useEffect to watch for write permission changes and dismiss the modal when the user doesn't have required permission.
// Close the modal if user loses write access (e.g., admin switches "Who can post" to Admins only)constisReportArchived=useReportIsArchived(reportID);constcanPerformWriteAction=useMemo(()=>canUserPerformWriteAction(report,isReportArchived),[report,isReportArchived]);useEffect(()=>{if(canPerformWriteAction){return;}Navigation.dismissModal();},[canPerformWriteAction]);
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
changed the title [-]The send attachment modal is not closed when admin changes who can post to Admins only[/-][+][$250] The send attachment modal is not closed when admin changes who can post to Admins only[/+]on Oct 30, 2025
changed the title [-][$250] The send attachment modal is not closed when admin changes who can post to Admins only[/-][+][Due for payment 2025-12-03] [$250] The send attachment modal is not closed when admin changes who can post to Admins only[/+]on Nov 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.63-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@mananjadhav / @Krishna2323@twisterdotcom The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: Couldn't pinpoint the offending PR.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Oct 30, 2025
Triggered auto assignment to @twisterdotcom (
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.Nodebrute commentedon Oct 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The send attachment modal is not closed when admin changes who can post to Admins only
What is the root cause of that problem?
Currently we don't have any logic that closes the modal when user change the permission to admins only.
What changes do you think we should make in order to solve the problem?
We can track previous
isAdminsOnlyPostingRoomstate withusePrevioushook and detect the permission change(All members -> admins only) and then dismiss the modal when a non-admin loses posting permission.App/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx
Lines 109 to 111 in 5e9789b
pseudo code
What alternative solutions did you explore? (Optional)
Alternatively, we can check if
isAdminsOnlyPostingRoomand user is not the admin then dismiss the modaltwisterdotcom commentedon Oct 30, 2025
@akinwale is this correct? These testing steps don't seem to work: #64556 (comment)
Krishna2323 commentedon Oct 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The send attachment modal is not closed when admin changes who can post to Admins only
What is the root cause of that problem?
ReportAddAttachmentModalContentcomponent does not have any logic to close the modal when write permissions are changed.BaseModal’sunmount path never runs.REPORT_ADD_ATTACHMENTis a dedicated route.What changes do you think we should make in order to solve the problem?
useEffectto watch for write permission changes and dismiss the modal when the user doesn't have required permission.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
akinwale commentedon Oct 30, 2025
Yes, they should be correct. Here's the video from when I tested.
65738-web-1.mp4
Krishna2323 commentedon Oct 30, 2025
PROPOSAL UPDATED
[-]The send attachment modal is not closed when admin changes who can post to Admins only[/-][+][$250] The send attachment modal is not closed when admin changes who can post to Admins only[/+]melvin-bot commentedon Oct 30, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021983922271257047610
melvin-bot commentedon Oct 30, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)30 remaining items
[-][$250] The send attachment modal is not closed when admin changes who can post to Admins only[/-][+][Due for payment 2025-12-03] [$250] The send attachment modal is not closed when admin changes who can post to Admins only[/+]melvin-bot commentedon Nov 26, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.63-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-12-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 26, 2025
@mananjadhav / @Krishna2323 @twisterdotcom The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
mananjadhav commentedon Dec 2, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: Couldn't pinpoint the offending PR.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/574189
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-2054-a474-90cf-5e97b409b844mananjadhav commentedon Dec 2, 2025
@twisterdotcom This one is ready for payout on Dec 03
twisterdotcom commentedon Dec 3, 2025
Payment Summary:
Krishna2323 commentedon Dec 6, 2025
Requested in ND.
quinthar commentedon Dec 8, 2025
Approved $250 to @Krishna2323
quinthar commentedon Dec 8, 2025
Approved $250 to @mananjadhav