Skip to content

[Wise] [No QA] Support enhanced due diligence - #105655

Open
mikolajpochec wants to merge 28 commits into
Expensify:mainfrom
software-mansion-labs:@mikolajpochec/wise-enhanced-due-diligence
Open

mikolajpochec wants to merge 28 commits into
Expensify:mainfrom
software-mansion-labs:@mikolajpochec/wise-enhanced-due-diligence

Conversation

@mikolajpochec

@mikolajpochec mikolajpochec commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Explanation of Change

Asks for the source of wealth of a business that needs enhanced due diligence, behind the wiseReimbursements beta.

When the pages show

  • The business page's save can return KYC requirements Expensify collects before Submit (achData.wise.kycRequirements, requestedBy: EXPENSIFY). They add pages after the business page.
  • Requirements that arrive while the user is on the confirmation page move them to the first unanswered page.
  • A reload or a direct link reads the bank account's requirements in the background.
  • A requirement marked isHostedOnly, or one the App has no page for, adds no page.

Pages

  1. "Where does your company's money come from?": multiselect over attributes.acceptedValues.
  2. "Which sources fund your daily operations?": multiselect over the picked sources.
    • Skipped when one source is picked.
    • Shown again, with the earlier answers selected, when a source is added from the confirmation page.
  3. "Source of wealth documents": upload buttons for each picked source.

Saving

  • Pages 1 and 2 save together under BUSINESS_SOURCE_OF_WEALTH_INFO, as sourceOfWealthList with one {businessSourceOfWealthInfo, isSourceOfFund} entry per source.
  • Every entry has isSourceOfFund. A lone source sends true. A newly added source sends false until page 2 says otherwise.
  • Page 3 saves under BUSINESS_SOURCE_OF_WEALTH_PROOF:
    • each file goes under proofFile-<source>-<documentType>
    • documents lists every key of every picked source, empty lists included
    • inputs is {}, since Auth rejects [] with "Inputs is not a valid json object"

Upload buttons (from attributes.acceptedDocumentTypesBySource)

  • A source in attributes.sourcesNeedingBankStatement gets its own "Upload bank statement" button, with a hint on what the statement must show.
  • One document type: the button is named after it and opens the file picker.
  • Several types ("Upload file"): the button asks for the type first. A menu under the button on wide screens, a sheet from the bottom on narrow ones.
  • Files list under their button, with the type above them when the button offers several.

File rules

  • Every button needs at least one file.
  • Up to 10 files per source, across its buttons.
  • Up to 20 new files per save. The server keeps 20 and drops the rest without an error, so Next stops with the existing "too many files" error.
  • The same file can go under two buttons. Under one button, a file with the same name is left out with an error. Names are compared lowercased with symbols replaced by _, as the server stores them.

Shared components

  • DynamicForm file fields take uploads: one entry per button, with its fileTypes, label and hint.
  • UploadFile moved to src/components/UploadFile/. Its picker can draw its own control.
  • Checkbox rows in a selection list take their own Enter press, so Enter on a focused source toggles it instead of pressing Next.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/693935
PROPOSAL:

Tests

A dev account has no Bancorp-verified US business account, so the snippet below adds the account and the requirements by hand, with the attributes Wise sends for a high-risk industry. A fetch of the bank account list overwrites the account, so paste it again after a reload.

Console snippet

Paste this in the browser console (web) or run it through the JS debugger (native) on Account > Wallet:

window.setBankAccount = () => {
    Onyx.merge('betaOverrides', {wiseReimbursements: true});
    Onyx.merge('bankAccountList', {
        9053192: {
            accountType: 'bankAccount',
            bankCurrency: 'USD',
            bankCountry: 'US',
            title: 'Chase Checking',
            description: 'Account ending in 1234',
            methodID: 9053192,
            accountData: {
                bankAccountID: 9053192,
                addressName: 'Boulder Development Inc.',
                accountNumber: 'XXXX1234',
                state: 'OPEN',
                type: 'BUSINESS',
                additionalData: {currency: 'USD', country: 'US', isGlobalReimbursementEnabled: false},
            },
        },
    });
};
window.setRequirements = (keys = ['BUSINESS_SOURCE_OF_WEALTH_INFO', 'BUSINESS_SOURCE_OF_WEALTH_PROOF']) => {
    const attributes = {
        acceptedValues: ['REVENUE', 'PERSONAL_FUNDING', 'BUSINESS_LOAN', 'FUNDING_AND_SHAREHOLDER_INVESTMENTS', 'INVESTMENT_INCOME', 'DONATIONS', 'GRANTS', 'LEGAL'],
        acceptedDocumentTypesBySource: {
            REVENUE: ['TAX_DOCUMENTS', 'AUDITED_FINANCIAL_STATEMENTS', 'BANK_STATEMENT', 'E_COMMERCE_STATEMENTS', 'INVOICES', 'CONTRACTS'],
            BUSINESS_LOAN: ['LOAN_AGREEMENT', 'BANK_STATEMENT'],
            FUNDING_AND_SHAREHOLDER_INVESTMENTS: ['EQUITY_AGREEMENT', 'SUBSCRIPTION_AGREEMENT', 'SHARE_SALE_CERTIFICATE', 'BANK_STATEMENT'],
        },
        sourcesNeedingBankStatement: ['BUSINESS_LOAN', 'DONATIONS', 'FUNDING_AND_SHAREHOLDER_INVESTMENTS', 'GRANTS', 'INVESTMENT_INCOME'],
    };
    Onyx.merge('reimbursementAccount', {
        achData: {
            bankAccountID: 9053192,
            wise: {kycRequirements: keys.map((key) => ({key, state: 'NOT_PROVIDED', isHostedOnly: false, requestedBy: 'EXPENSIFY', attributes}))},
        },
    });
};
Onyx.set('wiseBusinessOnboardingFormDraft', null);
setBankAccount();
  1. Go to Account > Wallet and paste the snippet
  2. Open the three-dot menu of "Chase Checking", press "Enable global reimbursements", then "Get started"
  3. Fill in the representative and business pages, press Next on the business page and verify that the confirmation page shows
  4. Run setRequirements() and verify that "Where does your company's money come from?" opens with a checkbox list of all eight sources
  5. Select "Business revenue" only, press Next and verify that "Source of wealth documents" opens with one "Upload file" button under "Business revenue"
  6. Press Back, select "Business loan" and "Funding & shareholder investments" too, press Next and verify that "Which sources fund your daily operations?" lists only the three picked sources
  7. Select "Business loan" and "Funding & shareholder investments", press Next and verify that:
    • "Business loan" has "Upload loan agreement" and "Upload bank statement", with "Must show the loan funds received." under the bank statement button
    • "Funding & shareholder investments" has "Upload file" and "Upload bank statement"
    • "Business revenue" has "Upload file", since every picked source needs proof
  8. Press Next without files and verify that an error shows under every button
  9. Press "Upload loan agreement" and verify that the file picker opens. Pick a file with a long name and verify that the name is shortened and the remove button stays visible
  10. Press "Upload file" under "Funding & shareholder investments" and verify that a menu with "Equity agreement", "Subscription agreement" and "Share sale certificate" opens under the button (a sheet from the bottom on a narrow screen)
  11. Pick "Equity agreement" and a file, and verify that the file shows under the button with "Equity agreement" above it
  12. Under "Upload loan agreement", pick the same file again and verify that it is not added and "A file with the same name is already added." shows. Pick it under "Upload bank statement" and verify that it is added
  13. Try to add files so that "Business loan" holds more than 10, and verify that they are not added and "You can only upload up to 10 files at a time." shows
  14. Add more than 20 new files across the sources, press Next and verify that the page stays and "You can only upload up to 20 files at a time." shows under a source. Remove files until 20 or fewer are new
  15. Upload a bank statement for both sources and a revenue document, press Next and verify that the confirmation page shows
  16. Press the documents row on the confirmation page and verify that the files show under their own names, without the server's prefix. Press Next
  17. In the network tab, verify that UpdateWiseOnboardingAdditionalData was sent:
    • with step=BUSINESS_SOURCE_OF_WEALTH_INFO and sourceOfWealthList in inputs, the two funding sources with isSourceOfFund: true and revenue with isSourceOfFund: false
    • with step=BUSINESS_SOURCE_OF_WEALTH_PROOF, inputs={}, documents listing the proofFile-REVENUE-*, proofFile-BUSINESS_LOAN-* and proofFile-FUNDING_AND_SHAREHOLDER_INVESTMENTS-* keys, and the files as proofFile-<source>-<documentType>[0]
  18. On the confirmation page, edit the sources, add "Grants", press Next and verify that UpdateWiseOnboardingAdditionalData sends "Grants" with isSourceOfFund: false, and that "Which sources fund your daily operations?" opens with "Business loan" and "Funding & shareholder investments" already selected
  19. Run setRequirements([]) and verify that the requirement rows are gone from the confirmation page
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@melvin-bot

melvin-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@mikolajpochec
mikolajpochec marked this pull request as ready for review November 2, 2026 17:31
@mikolajpochec
mikolajpochec requested review from a team as code owners November 2, 2026 17:31
@melvin-bot
melvin-bot Bot requested review from ZhenjaHorbach and removed request for a team November 2, 2026 17:31
@melvin-bot

melvin-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

@ZhenjaHorbach 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]

@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and removed request for a team November 2, 2026 17:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T17:49:35.507279Z fd5730d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread src/components/DynamicForm/index.tsx Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd5730d702

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/actions/WiseOnboarding.ts Resolved
@JmillsExpensify
JmillsExpensify requested review from joekaufmanexpensify and removed request for JmillsExpensify November 2, 2026 18:54
@heekinho

heekinho commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Some questions here, cc @danieldoglas @grgia
I see that we can select multiple source of wealth. For example, I chose "Fossil fuel extraction" and the page appeared. Then I selected "Business revenue" and "Personal funding". Then on the next page it asked for the source of funds document. But I think we are missing the proper matching.

https://docs.wise.com/guides/product/account-setup/customer-onboarding/kyc-requirement-types#business_source_of_wealth_proof

It seems to me that when collecting the source of wealth, for each one we should also ask if that will be used to fund in the context of answering "Out of all the financial buckets your business has access to, which one(s) are you relying on to capitalize, fund, or operate this newly created account?”. https://docs.wise.com/guides/product/account-setup/customer-onboarding/kyc-requirement-types#business_source_of_wealth_info

And it seems that we should send the proof file for each of the source of wealth and also tell which type of document that is. So the page asking the files seems to be missing that. It's just send raw files without proper mapping for source and doc type: https://docs.wise.com/guides/product/account-setup/customer-onboarding/kyc-requirement-types#business_source_of_wealth_proof

@grgia

grgia commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

I see that we can select multiple source of wealth.

This was feedback from wise, originally it was thought to be only one- will need to look into how wise would differentiate and update the Save command

@grgia

grgia commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@heekinho I am confirming with wise here - https://expensify.slack.com/archives/C0AMKE9PMEZ/p1793650586983249?thread_ts=1793650538.648989&cid=C0AMKE9PMEZ

@heekinho

heekinho commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thanks, @grgia! No access to that, tho 😄

…-enhanced-due-diligence

# Conflicts:
#	src/pages/settings/Wallet/EnableGlobalReimbursements/Wise/WiseBusinessOnboardingPage.tsx
@mikolajpochec mikolajpochec changed the title [HOLD] [Wise] Support enhanced due diligence [Wise] Support enhanced due diligence Nov 2, 2026
@grgia

grgia commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

It is Web, not the App. The firewall rule for inputs rejects {} because it needs at least one key, so Web gets an empty string and throws. Auth accepts {}. Fix: https://github.com/Expensify/Web-Expensify/pull/57909

@heekinho

heekinho commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

I tested and noticed this as well in App PR. Please check it. Testing your PR

@heekinho

heekinho commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Yes. Only passes for me with the following changes here:

-        inputs: Object.keys(inputs).length > 0 ? JSON.stringify(inputs) : '[]',
+        inputs: Object.keys(inputs).length > 0 ? JSON.stringify(inputs) : '{}',

@mikolajpochec

mikolajpochec commented Nov 13, 2026 •

Copy link
Copy Markdown
Member Author

Thank you for your comments @joekaufmanexpensify! I've addressed them, and just to make clear how things are after the new commits:

  1. Screen flash after picking a high-risk industry (3ada34e): now a spinner shows while the business page saves, then you land straight on the next page.
  2. Misleading hint text (fd61442): hints now mention the bank statement too.
  3. Daily operations page skipped after editing sources (027b932): going from one source to more now asks it again.
  4. Same document blocked with no feedback (9e0062b): the same file can now go under different buttons. Fixes @grgia's comment too!

While testing I also found that the server keeps only 20 new files per save and drops the rest without an error. I think we should handle that in the UI somehow. @grgia @joekaufmanexpensify, how would you like us to show it? I think it's worth doing in a follow-up.

…-enhanced-due-diligence

# Conflicts:
#	src/components/UploadFile.tsx
#	tests/ui/pages/settings/Wallet/WiseBusinessOnboardingPageTest.tsx
@grgia

grgia commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

While testing I also found that the server keeps only 20 new files per save and drops the rest without an error. I think we should handle that in the UI somehow.

Agree, lets fix in this PR: cap the total at 20 files per save in the UI and show the existing "too many files" error.

  • Keep the per-source limit at 10 and scope only the duplicate check to the button.
  • Show an error for the same file under one button.

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

That all sounds good to me. I will retest in a bit. 🫡

@github-actions

Copy link
Copy Markdown
Contributor

🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

With default CONST.WISE.SOURCE_OF_WEALTH_DOCUMENT_TYPEs we don't have enough space to show all elements and don't have scroll

Screenshot 2026-11-13 at 17 40 42

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

I retested this navigation bug and confirmed it is working correctly when you go from one to multiple sources of wealth selected from the confirmation page. However, if you already have multiple selected and add an additional one on top of that (for example, 2 to 3), we're still skipping the Fund Daily Operations question after you select the additional source of wealth.

I don't think that's the correct implementation. I would expect that any time you add an additional source of wealth from the confirmation page, we would prompt you to select whether to update your response to the "fund daily operations" question (because any additional source of wealth selected could presumably fund daily operations). Please see video below.

2026-11-13_13-56-20.mp4

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

BUG: renaming documents after revisiting the document upload page from the confirmation page

Initially, when the user uploads a document, we show the file name in the frontend. If you then revisit the file upload page from the confirmation page, we seem to be showing some type of internal document reference name instead of the user's file name. I find this a bit confusing. I think it's helpful feedback to the user to always show them their document file name in the frontend for what they have uploaded.

2026-11-13_14-06-22.mp4

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

All of the other fixes are working well from my perspective!

@grgia

grgia commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

#105655 (comment)
With default CONST.WISE.SOURCE_OF_WEALTH_DOCUMENT_TYPEs we don't have enough space to show all elements and don't have scroll

@mikolajpochec are we using the existing component? I thought we already use this new pattern in some inputs in app which definitely have scroll

@mikolajpochec

Copy link
Copy Markdown
Member Author

are we using the existing component?

Yes, we are! One prop was missing, I've added it 😄. It now scrolls correctly

1.Wallet.-.High.memory.usage.-.1.3.GB.-.Google.Chrome.Mi.2026-11-16.at.12.35.04.mov

@mikolajpochec

Copy link
Copy Markdown
Member Author

I don't think that's the correct implementation. I would expect that any time you add an additional source of wealth from the confirmation page, we would prompt you to select whether to update your response to the "fund daily operations" question (because any additional source of wealth selected could presumably fund daily operations). Please see video below.

That makes more sense. Fixed in d07eb56. Now any newly added source of wealth brings back the daily operations page, with your previous answers already selected.

Initially, when the user uploads a document, we show the file name in the frontend. If you then revisit the file upload page from the confirmation page, we seem to be showing some type of internal document reference name instead of the user's file name.

I agree it's not what you'd expect. The backend changes these names. It adds a prefix, lowercases them, and replaces spaces, dots and non-English characters with _, so there's no perfect fix on the frontend. In f8867e1 I cut the prefix off, but Document 1.pdf still comes back as document_1.pdf. I don't think that's much of a problem, since users can still tell their documents apart. If we want the exact name, the backend would need to return the original one.

@mikolajpochec

Copy link
Copy Markdown
Member Author

Agree, lets fix in this PR

Done, I've applied this fix too. The error shows under the source where the count of new files goes over the cap. The limit of 10 files now counts all buttons of a source together. Regarding uploading the same file twice, I've implemented a naive solution comparing normalized names, to match the server's naming convention.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@mikolajpochec

Copy link
Copy Markdown
Member Author

@grgia @joekaufmanexpensify All comments have been addressed! 😄

@github-actions

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #105655 with the pinned Mobile-Expensify submodule.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Web 🕸️
https://105655.adhoc.expensify.com
Web

👀 View the workflow run that generated this build 👀

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixes for the two bugs I reported are both working well. Good from my perspective. 👍


/** Saved files come back from the server with lowercased names and symbols replaced, so names are compared in that form to catch the same file picked again */
function getComparableFileName(fileName = ''): string {
return fileName.toLowerCase().replaceAll(/[^a-z0-9]/g, '_');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocks

an admin who uploads two documents with Japanese, Chinese or Cyrillic names of the same length under one upload button sees "A file with the same name is already added" and the second file is left out.

getComparableFileName turns 契約書.pdf and 請求書.pdf both into ____pdf, and UploadFile on the non-USD bank account pages goes through it too. can the looser compare apply only against saved files?

@mikolajpochec mikolajpochec Nov 16, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a problem. I'll fix the blocking part. New files will be compared by their exact names, so 契約書.pdf and 請求書.pdf can both go under one button.

But there's a bigger problem that the frontend can't fix. The server seems to replace every UTF-8 byte of a non-English name with _, so both files above are stored as _________.pdf. A user who uploads such files can't tell them apart when they continue onboarding later, on the same or another device.

I think it's worth opening a backend issue for this one. I suppose the cleanup happens because of Wise's API requirements, so couldn't we store the original name on our server and send the processed one when the user submits?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @mikolajpochec, comparing new files by their own names covers it. The files are safe, each one gets its own key, so only the name is lost. I've opened https://github.com/Expensify/Expensify/issues/705057 for the names, on hold until Singapore onboarding.

…-enhanced-due-diligence

# Conflicts:
#	src/components/SelectionList/ListItemComposed/ListItemPressable.tsx

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants