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-10-28] [Follow-up] Per diem import silently fails when the workspace has no PerDiemInternational custom unit #101066
A workspace can have arePerDiemRatesEnabled: true while having no PerDiemInternational custom unit. On those workspaces, per diem rates can never be added:
Import spreadsheet is reachable from the header's More dropdown (WorkspacePerDiemPage.tsx:202), so the user can upload a CSV and map all four columns.
Then nothing happens: ImportedPerDiemPage.tsx:122 bails out of importRates on !perDiemCustomUnit?.customUnitID, with no error shown.
This is pre-existing, not introduced by #100956. That PR removes the never-resolving spinner on the same page, and was merged for urgency without waiting on this. Both symptoms come from the same workspace state.
Two things to answer
Why do these workspaces exist? Find how a policy ends up with arePerDiemRatesEnabled: true and no PerDiemInternational custom unit — a backfill gap, an enable path that skips unit creation, or something else. This may need a backend fix rather than an App fix.
Where should the unit get created? Provisioning on page render would write policy state from opening a read-only page, so the import itself looks like the right place. That needs a backend answer on whether ImportPerDiemRates can create the unit when the customUnitID doesn't exist yet, or whether the App must create it first.
At minimum, the silent return at ImportedPerDiemPage.tsx:122 should surface an error instead of doing nothing.
Steps to reproduce
Open a workspace with Per diem enabled but no PerDiemInternational custom unit.
Go to Workspace settings > Per diem.
Open the More dropdown and pick Import spreadsheet.
Upload a CSV with Destination / Subrate / Currency / Amount columns and map all four.
Confirm the import. Nothing happens and no error appears.
Some policies come back with per diem enabled and no per diem custom unit. The request succeeds and the flag is true, but the custom units object contains only the distance unit. The page then has no rates to show. The import also cannot run, because it needs a custom unit ID that does not exist.
We cannot reproduce this from the app. The only code that sets the flag creates the custom unit in the same call, and we confirmed that on a new workspace.
Could someone from the backend side take a look at three things:
What sets the flag on these policies without creating the custom unit?
Can we create the missing unit for every policy already in this state? That would fix all the affected workspaces at once, and it is not covered by the follow-up issue.
If that is not possible, does the import command create the custom unit itself when it receives a custom unit ID that does not exist yet?
So when we copy the workspace settings, our Backend logic will set the per-diem enabled based on arePerDiemRatesEnabledfield (default to true). I think that's the RCA. Let me check why these logics were added at first place.
Activity
BartekObudzinski commentedon Sep 14, 2026
Some policies come back with per diem enabled and no per diem custom unit. The request succeeds and the flag is true, but the custom units object contains only the distance unit. The page then has no rates to show. The import also cannot run, because it needs a custom unit ID that does not exist.
We cannot reproduce this from the app. The only code that sets the flag creates the custom unit in the same call, and we confirmed that on a new workspace.
Could someone from the backend side take a look at three things:
hungvu193 commentedon Sep 15, 2026
So when we copy the workspace settings, our Backend logic will set the per-diem enabled based on
arePerDiemRatesEnabledfield (default to true). I think that's the RCA. Let me check why these logics were added at first place.BartekObudzinski commentedon Sep 17, 2026
Hi @hungvu193 How the things are going?
hungvu193 commentedon Sep 17, 2026
Sorry for the delay. I have limited avaibility this week. I'll try to raise a PR before EOW
hungvu193 commentedon Sep 21, 2026
Working on a draft for the BE task: https://github.com/Expensify/Web-Expensify/pull/56337
melvin-bot commentedon Sep 24, 2026
@hungvu193 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
35 remaining items
huult commentedon Oct 22, 2026
This ticket will be paid at $250 because I was assigned to it on September 14.
melvin-bot commentedon Oct 27, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 27, 2026
Payment Summary
Resolving PRs:
fix: show an error when importing per diem rates without a per diem unit #103605
Contributor: @hungvu193 does not require payment (Contractor)
Reviewer: @huult owed $175 via NewDot
Contributor: @BartekObudzinski does not require payment (Contractor)
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 30, 2026
Payment Summary
Contributor+: @huult due $175 via NewDot
JmillsExpensify commentedon Nov 14, 2026
$175 approved for @huult