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 2026-04-28] [$250] Android & iOS - Chronos - Start timer dropdown button is broken #87820
Version Number: V9.3.59.1 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#87543 Email or phone of affected tester (no customers):dreamnitethedragon+vegst@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redmi note 10s android 13 App Component: User Settings
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
getCustomUnitsForDuplication in PolicyUtils.ts:312-352 copies the source workspace's custom unit objects verbatim under new record keys, but never updates the internal customUnitID field. This creates a mismatch: the Onyx record key is the new ID, but customUnit.customUnitID still holds the old source workspace's ID.
When the user adds a distance rate, CreateDistanceRatePage.tsx:43-44 reads customUnit.customUnitID (the stale old ID) and passes it to createPolicyDistanceRate. The server rejects this because the duplicated workspace's custom unit was created with the new ID.
What changes do you think we should make in order to solve the problem?
In getCustomUnitsForDuplication (PolicyUtils.ts), spread the unit object and override customUnitID with the new ID on all three return paths:
Line 336: {[distanceCustomUnitID]: {...distanceCustomUnit, customUnitID: distanceCustomUnitID}, [perDiemCustomUnitID]: {...perDiemUnit, customUnitID: perDiemCustomUnitID}}
Line 344: {[distanceCustomUnitID]: {...distanceCustomUnit, customUnitID: distanceCustomUnitID}}
Line 351: {[perDiemCustomUnitID]: {...perDiemUnit, customUnitID: perDiemCustomUnitID}}
The existing unit test at PolicyUtilsTest.ts:338 should also be updated to pass genuinely different IDs (instead of reusing the source unit's ID) so the mismatch is caught in tests.
Investigation details
Data flow:
buildDuplicatePolicyData calls buildOptimisticDistanceRateCustomUnits generating a new distanceCustomUnitID (UUID)
getCustomUnitsForDuplication finds the source unit by name and returns {[newID]: originalUnitObject} where originalUnitObject.customUnitID is the old ID
Server receives distanceCustomUnitID: newID in the DuplicatePolicy params and creates the unit with that new ID
CreateDistanceRatePage calls getDistanceRateCustomUnit(policy) which returns the object with customUnitID: oldID
createPolicyDistanceRate(policyID, oldID, newRate) fails because oldID doesn't exist on the server for the new workspace
Same bug affects perDiem rates on duplicated workspaces (same code paths, lines 336 and 347-351).
Possibly related:#86116 ("In duplicate workspace, creating distance manual expense shows unexpected error") likely shares the same root cause.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Classification: Needs more context - potentially Frontend bug or pre-existing issue
Causing PR: No single high-confidence causing PR identified
Related Issues: None identified
Recommendation: NEEDS INVESTIGATION
Cannot identify the root-cause PR with sufficient confidence. The bug is staging-only and is likely a pre-existing issue in the workspace duplication and distance rates flow, rather than a regression from a specific PR in this staging build.
Labels: No changes made - keeping DeployBlockerCash until root cause is confirmed
Detailed Analysis
Bug scenario: New user logs in via track and budget expense onboarding, duplicates the created workspace, opens the duplicate workspace, navigates to Distance Rates, tries to add a rate, and fails.
Version: V9.3.58-3 (staging only, not reproducible in production).
Likely root cause (pre-existing):
When a workspace is duplicated, buildDuplicatePolicyData in src/libs/actions/Policy/Policy.ts sets custom units via getCustomUnitsForDuplication. For a brand-new onboarding user, the workspace is created with areDistanceRatesEnabled: false. The Distance Rates feature option does NOT appear in WorkspaceDuplicateSelectFeaturesForm because it only shows when ratesCount > 0 AND policy?.areDistanceRatesEnabled (line 150 of WorkspaceDuplicateSelectFeaturesForm.tsx).
Therefore isDistanceRatesOptionSelected is false, and customUnits is undefined in the duplicated workspace optimistic data. If the user then manually enables Distance Rates via More Features on the duplicate workspace, getDistanceRateCustomUnit(policy) still returns undefined because no distance custom unit was ever copied.
When the user navigates to CreateDistanceRatePage, line 50 checks:
const FullPageBlockingView = !customUnitID ? FullPageOfflineBlockingView : View
With customUnitID undefined, the offline blocking view is shown, preventing the user from adding a rate.
Relevant files:
src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx - FullPageOfflineBlockingView guard at line 50
src/pages/workspace/duplicate/WorkspaceDuplicateSelectFeaturesForm.tsx - distanceRates option only shows if ratesCount > 0 AND policy?.areDistanceRatesEnabled (line 150)
src/libs/PolicyUtils.ts - getCustomUnitsForDuplication at line 312 returns undefined when distance rates not selected
PRs checked from staging that are NOT the cause:
PR 87334 (Refactor ConfirmModal usage in workspace settings pages part 3) - only changes delete/warning modals in PolicyDistanceRatesPage.tsx, not the add-rate flow.
PR 87694 (Split accounting and HR connection groups) - modifies WorkspaceDuplicateSelectFeaturesForm.tsx but only for accounting connection filtering, does not affect distance rate custom unit creation.
Why staging-only: The test used a brand-new account with track and budget expense onboarding - an edge case discovered through exploratory QA.
Next steps:
Confirm whether Distance Rates was enabled via More Features AFTER duplicating, or was selected during the duplication features form
Verify if the issue reproduces when the source workspace has areDistanceRatesEnabled: true with existing rates
If confirmed pre-existing: fix enablePolicyDistanceRates in src/libs/actions/Policy/DistanceRate.ts to also create a default customUnit when enabling Distance Rates on a workspace that lacks one
@ZhenjaHorbach 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 and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[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: NA
[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.
@ZhenjaHorbach I'm unsure but.. I'd prefer to add the test steps in case QA wants 'em, cuz they can choose to test UI/design related issues weekly or monthly (or.. just close the issue)
@ZhenjaHorbach I'm unsure but.. I'd prefer to add the test steps in case QA wants 'em, cuz they can choose to test UI/design related issues weekly or monthly (or.. just close the issue)
Activity
melvin-bot commentedon Apr 13, 2026
Triggered auto assignment to @srikarparsi (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Apr 13, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 13, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Apr 13, 2026
Proposal
What is the root cause of that problem?
getCustomUnitsForDuplicationinPolicyUtils.ts:312-352copies the source workspace's custom unit objects verbatim under new record keys, but never updates the internalcustomUnitIDfield. This creates a mismatch: the Onyx record key is the new ID, butcustomUnit.customUnitIDstill holds the old source workspace's ID.When the user adds a distance rate,
CreateDistanceRatePage.tsx:43-44readscustomUnit.customUnitID(the stale old ID) and passes it tocreatePolicyDistanceRate. The server rejects this because the duplicated workspace's custom unit was created with the new ID.What changes do you think we should make in order to solve the problem?
In
getCustomUnitsForDuplication(PolicyUtils.ts), spread the unit object and overridecustomUnitIDwith the new ID on all three return paths:{[distanceCustomUnitID]: {...distanceCustomUnit, customUnitID: distanceCustomUnitID}, [perDiemCustomUnitID]: {...perDiemUnit, customUnitID: perDiemCustomUnitID}}{[distanceCustomUnitID]: {...distanceCustomUnit, customUnitID: distanceCustomUnitID}}{[perDiemCustomUnitID]: {...perDiemUnit, customUnitID: perDiemCustomUnitID}}The existing unit test at
PolicyUtilsTest.ts:338should also be updated to pass genuinely different IDs (instead of reusing the source unit's ID) so the mismatch is caught in tests.Investigation details
Data flow:
buildDuplicatePolicyDatacallsbuildOptimisticDistanceRateCustomUnitsgenerating a newdistanceCustomUnitID(UUID)getCustomUnitsForDuplicationfinds the source unit by name and returns{[newID]: originalUnitObject}whereoriginalUnitObject.customUnitIDis the old IDpolicy.customUnits = {[newID]: {customUnitID: oldID, ...}}distanceCustomUnitID: newIDin the DuplicatePolicy params and creates the unit with that new IDCreateDistanceRatePagecallsgetDistanceRateCustomUnit(policy)which returns the object withcustomUnitID: oldIDcreatePolicyDistanceRate(policyID, oldID, newRate)fails becauseoldIDdoesn't exist on the server for the new workspaceSame bug affects perDiem rates on duplicated workspaces (same code paths, lines 336 and 347-351).
Possibly related: #86116 ("In duplicate workspace, creating distance manual expense shows unexpected error") likely shares the same root cause.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.OSBotify commentedon Apr 13, 2026
Investigation Summary
Classification: Needs more context - potentially Frontend bug or pre-existing issue
Causing PR: No single high-confidence causing PR identified
Related Issues: None identified
Recommendation: NEEDS INVESTIGATION
Cannot identify the root-cause PR with sufficient confidence. The bug is staging-only and is likely a pre-existing issue in the workspace duplication and distance rates flow, rather than a regression from a specific PR in this staging build.
Labels: No changes made - keeping DeployBlockerCash until root cause is confirmed
Detailed Analysis
Bug scenario: New user logs in via track and budget expense onboarding, duplicates the created workspace, opens the duplicate workspace, navigates to Distance Rates, tries to add a rate, and fails.
Version: V9.3.58-3 (staging only, not reproducible in production).
Likely root cause (pre-existing):
When a workspace is duplicated, buildDuplicatePolicyData in src/libs/actions/Policy/Policy.ts sets custom units via getCustomUnitsForDuplication. For a brand-new onboarding user, the workspace is created with areDistanceRatesEnabled: false. The Distance Rates feature option does NOT appear in WorkspaceDuplicateSelectFeaturesForm because it only shows when ratesCount > 0 AND policy?.areDistanceRatesEnabled (line 150 of WorkspaceDuplicateSelectFeaturesForm.tsx).
Therefore isDistanceRatesOptionSelected is false, and customUnits is undefined in the duplicated workspace optimistic data. If the user then manually enables Distance Rates via More Features on the duplicate workspace, getDistanceRateCustomUnit(policy) still returns undefined because no distance custom unit was ever copied.
When the user navigates to CreateDistanceRatePage, line 50 checks:
const FullPageBlockingView = !customUnitID ? FullPageOfflineBlockingView : View
With customUnitID undefined, the offline blocking view is shown, preventing the user from adding a rate.
Relevant files:
PRs checked from staging that are NOT the cause:
PR 87334 (Refactor ConfirmModal usage in workspace settings pages part 3) - only changes delete/warning modals in PolicyDistanceRatesPage.tsx, not the add-rate flow.
PR 87694 (Split accounting and HR connection groups) - modifies WorkspaceDuplicateSelectFeaturesForm.tsx but only for accounting connection filtering, does not affect distance rate custom unit creation.
Why staging-only: The test used a brand-new account with track and budget expense onboarding - an edge case discovered through exploratory QA.
Next steps:
36 remaining items
melvin-bot commentedon Apr 21, 2026
@ZhenjaHorbach 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]
melvin-bot commentedon Apr 24, 2026
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Apr 27, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Apr 28, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Apr 28, 2026
Payment Summary
Contributor+: @ZhenjaHorbach due $250 via NewDot
@ZhenjaHorbach plz complete the BZ checklist and tag me in a post once you have. Thx
WIP adding start/stop buttons
ZhenjaHorbach commentedon Apr 29, 2026
BugZero Checklist:
da4425a#r183848079
[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: NA
[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.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-8729-a8d0-fff3-6ce8f02c19a4mallenexpensify commentedon Apr 29, 2026
@ZhenjaHorbach I'm unsure but.. I'd prefer to add the test steps in case QA wants 'em, cuz they can choose to test UI/design related issues weekly or monthly (or.. just close the issue)
ZhenjaHorbach commentedon Apr 30, 2026
It makes sense
Updated!
garrettmknight commentedon May 4, 2026
$250 approved for @ZhenjaHorbach