Fix: Remove generic error from failureData and move public domain check in Travel Invoicing#83095
Fix: Remove generic error from failureData and move public domain check in Travel Invoicing#83095
Conversation
…ck before disable toggle Remove the hardcoded generic error message from toggleTravelInvoicing failureData so server-provided error messages are preserved. Move the public domain check to the top of handleToggle so it runs for both enable and disable actions. Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
@MelvinBot can you fix tests, since we now send a specific error from Backend and remove generic error, we should remove it from tests also |
The errors field was removed from failureData in the source code so that the backend-provided error is preserved. Update the test to no longer expect errors in failureData. Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
|
Fixed the failing test. The Change: Removed the All 5 TravelInvoicing tests pass after the fix. |
…reData Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
…ttps://github.com/Expensify/App into claude-fixTravelInvoicingErrorAndPublicDomainCheck Co-authored-by: Ishpaul Singh <ishpaul777@users.noreply.github.com>
|
Fixed the failing |
rlinoz
left a comment
There was a problem hiding this comment.
Looks good, does this one needs to hold on the Web-E? I think it doesn't just double checking.
|
The only failing check is All code-related checks are passing: ESLint, typecheck, Prettier, tests (all 8 jobs), storybook, spellcheck, builds, and signed commits. |
|
we can merge, only issue will be no error mesage unitl BE deployed but its behind beta so no real user using it yet |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|

Explanation of Change
This PR makes two changes to Travel Invoicing:
Removes hardcoded generic error from
failureDataintoggleTravelInvoicing— Theerrorsfield with'common.genericErrorMessage'was overwriting server-provided error messages. By removing it fromfailureData, the actual backend error (delivered viaonyxData) is preserved and displayed to the user instead of the generic "Oops... something went wrong" message.Moves public domain check before the disable toggle path in
handleToggle— TheisFromPublicDomaincheck was previously only run in the "enable" path. Moving it to the top ofhandleToggleensures it runs for both enable and disable actions, blocking public domain users from interacting with Travel Invoicing regardless of toggle direction.Fixed Issues
$ #83039
PROPOSAL: #83039 (comment)
Tests
Offline tests
failureDatano longer sets errors)QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari