Fix unsafe assertions across receipt and settings flows - #98847
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Removes 15 unsafe type assertions across receipt scanning, USD bank-account setup, saved-search filter labels, report-detail columns, and Certinia prerequisites. The cleanup replaces assertions with runtime-backed narrowing, target-local prop adapters, canonical value membership checks, and exact translation maps while preserving the existing flows and fallbacks.
Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Count change
Current baseline source:
config/eslint/eslint.seatbelt.tsvat base1e666ea85c70e36de61a044adfa0227ec83ef18e.Before:
src/hooks/useReceiptScanDrop.tsx: 3 violationssrc/pages/ReimbursementAccount/USD/USDVerifiedBankAccountFlowPage.tsx: 3 violationssrc/pages/Search/SearchSavePage.tsx: 3 violationssrc/pages/settings/Report/ReportDetailsColumnsPage.tsx: 3 violationssrc/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx: 3 violationsAfter:
src/hooks/useReceiptScanDrop.tsx: 0 violationssrc/pages/ReimbursementAccount/USD/USDVerifiedBankAccountFlowPage.tsx: 0 violationssrc/pages/Search/SearchSavePage.tsx: 0 violationssrc/pages/settings/Report/ReportDetailsColumnsPage.tsx: 0 violationssrc/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx: 0 violationsNet reduction:
TSV evidence:
config/eslint/eslint.seatbelt.tsvbyte-for-byte after confirming zero cleanup findings in every target.Tests
src/components/AddressSearch/index.tsx.git diff --check, changed-path proof, and generated-TSV restoration passed.32110394646passed typecheck, lint, format, React Compiler, and Jest at signed commit9bf6e5da634cf3a4ec59bf2ec792903421c1c4f9.No manual application testing was performed; the evidence above is automated verification and independent review.
Offline tests
N/A: this assertion cleanup does not change networking or offline behavior, and no manual offline testing was performed.
QA Steps
PR Author Checklist
N/A rationale: no product behavior, copy, CSS, assets, networking, messaging flow, generic component, new feature, or bug flow is intended to change. No manual platform, high-traffic-account, offline, console, screenshot/video, staging, or production testing was performed. The affected production contracts and callers were inspected during planning and independent review, and exact-head CI covered the full repository checks. Every item below was considered against that scope.
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A: no UI or visual behavior changed, and no screenshots or videos were produced.
Changed files (5)
src/hooks/useReceiptScanDrop.tsxsrc/pages/ReimbursementAccount/USD/USDVerifiedBankAccountFlowPage.tsxsrc/pages/Search/SearchSavePage.tsxsrc/pages/settings/Report/ReportDetailsColumnsPage.tsxsrc/pages/workspace/accounting/certinia/prerequisites/CertiniaPrerequisitesStep.tsx