Fix required tags state after switching tag levels#92338
Conversation
|
Root Cause of the Tags Toggle Regression: More specifically:
Solution: The changes are:
This keeps the normal tags flow unchanged, while ensuring the settings UI reflects the backend state without needing a hard refresh. Fixed Demo: Screencast.From.2026-06-02.10-47-22.mp4 |
…toggling-required-tags
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@hoangzinh 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] |
|
@robertjchen 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@nabi-ebrahimi can you quickly explain the root cause of the previous deploy blocker? And your solution to fix it? |
@hoangzinh, thank you for taking the time to review this. I appreciate your feedback. Root Cause of The Previous Deploy Blocker: the tags settings screens were reading from stale Onyx policy data and did not refresh the tag state when returning from the import flow. After the tag cleanup completed, the UI still had the old requiresTag / areTagsEnabled snapshot, so the Tags toggle stayed disabled until a manual refresh remounted the screen. Solution: keep cleanPolicyTags() updating requiresTag only on success, and add a focus/reconnect refetch via openPolicyTagsPage(policyID) in both WorkspaceTagsSettingsPage and TagSettingsPage so the screens always pick up the latest backend state. Reproduced Deploy Blocker Demo: Screencast.From.2026-06-03.05-41-44.mp4 |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Second attempt on the PR
|
@hoangzinh, friendly bump. thanks. |
The RCA doesn't seem strong to me. Let me check |
|
@robertjchen Could you help me verify the value of
=> @robertjchen Can you check the current value of
=> @robertjchen Can you verify the current value of If in step 6, the value of Screen.Recording.2026-06-05.at.21.53.25.movCc @nabi-ebrahimi, I would like to hear your thoughts too. |
Explanation of Change
When a workspace switches between single-level and multi-level tags, the backend clears the existing tags and disables
Members must tag all expensesif keeping it enabled would leave the workspace in an invalid state.The problem is that the frontend did not reflect that backend change immediately. This created a confusing experience where the switch flow completed successfully, but the UI still showed
Members must tag all expensesas enabled until the user left and revisited the workspace settings. In other words, the workspace state was valid on the backend, but the frontend temporarily showed stale information.This PR fixes that inconsistency by updating the frontend after the tag cleanup request succeeds, so users see the correct required-tags state right away and the UI stays aligned with the backend during the tag-level switching flow.
Fixed Issues
$ #87472
PROPOSAL: #87472 (comment)
Tests
Workspace Settingsfor a Control Workspace →Tags.Add tags, enter any name, and clickSave.More→Settings, then enableMembers must tag all expenses.More→Import Spreadsheet→Multi-level tags.Switch Tag Levelswarning modal appears, then clickSwitch Tag Levels.More→Settings.Members must tag all expensesis automatically disabled after the switch succeeds.Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Screen.Recording.2026-06-02.at.10.52.27.PM.mov
Android: mWeb Chrome
screen-recorder-unlimited-2026-06-02-23-45-13.mp4
iOS: Native
Screen.Recording.2026-06-03.at.12.50.22.AM.mp4
iOS: mWeb Safari
Screen.Recording.2026-06-03.at.1.11.07.AM.mov
MacOS: Chrome / Safari
Screencast.From.2026-06-02.18-57-49.mp4