Skip to content

Cleanup unused APIs and FormIDs definition - #93906

Merged
Julesssss merged 3 commits into
Expensify:mainfrom
shubham1206agra:cleanup-formid-unused-apis
Jun 22, 2026
Merged

Julesssss merged 3 commits into
Expensify:mainfrom
shubham1206agra:cleanup-formid-unused-apis

Conversation

@shubham1206agra

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #86254

Tests

Please run smoke tests of the main flow: Sign in, Create Expense, Submit, etc

Offline tests

Same as Tests

QA Steps

Same as Tests

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 there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.

@shubham1206agra
shubham1206agra requested review from a team as code owners June 18, 2026 04:27
@melvin-bot
melvin-bot Bot requested review from QichenZhu and joekaufmanexpensify and removed request for a team June 18, 2026 04:27
@melvin-bot

melvin-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Comment thread src/libs/API/types.ts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Julesssss @roryabraham You may need to remove exposure from BE side for these commands.

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.

@MelvinBot look at the unused API endpoints being removed here. What is the newest app version that used any one of these endpoints? Also, please check server-side logs to check for any recent usages.

@roryabraham roryabraham Jun 18, 2026

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.

According to Melvin's response and Sentry data, ~25% of our users in the last 30 days were still using a version of the app older than the removal of the newest of these API endpoints:

script output
SENTRY_AUTH_TOKEN="$(op item get --fields notesPlain 'Sentry Auth Token')" ./scripts/sentry/release-adoption-older-than.ts --threshold 9.3.63-0 --period 30d --json
{
  "organization": "expensify",
  "project": "app",
  "environment": "production",
  "dataset": "errors",
  "window": "last 30d",
  "threshold": "9.3.63-0",
  "releasePrefix": "new.expensify@",
  "totalUniqueUsers": 151791,
  "uniqueUsersOnOlderReleases": 40931,
  "percentOnOlderReleases": 26.97,
  "olderReleaseCount": 122,
  "olderReleases": [
    "new.expensify@9.2.40-1",
    "new.expensify@9.2.41-6",
    "new.expensify@9.2.42-11",
    "new.expensify@9.2.43-2",
    "new.expensify@9.2.44-5",
    "new.expensify@9.2.46-3",
    "new.expensify@9.2.47-1",
    "new.expensify@9.2.54-1",
    "new.expensify@9.2.58-3",
    "new.expensify@9.2.60-2",
    "new.expensify@9.2.61-5",
    "new.expensify@9.2.62-5",
    "new.expensify@9.2.63-8",
    "new.expensify@9.2.64-5",
    "new.expensify@9.2.65-6",
    "new.expensify@9.2.66-3",
    "new.expensify@9.2.67-3",
    "new.expensify@9.2.67-10",
    "new.expensify@9.2.74-12",
    "new.expensify@9.2.76-0",
    "new.expensify@9.2.77-1",
    "new.expensify@9.2.78-2",
    "new.expensify@9.2.78-7",
    "new.expensify@9.2.81-5",
    "new.expensify@9.2.84-8",
    "new.expensify@9.2.85-7",
    "new.expensify@9.2.86-4",
    "new.expensify@9.2.87-7",
    "new.expensify@9.2.88-7",
    "new.expensify@9.2.89-6",
    "new.expensify@9.2.90-2",
    "new.expensify@9.2.91-1",
    "new.expensify@9.2.93-1",
    "new.expensify@9.2.94-4",
    "new.expensify@9.2.96-6",
    "new.expensify@9.2.98-0",
    "new.expensify@9.2.99-8",
    "new.expensify@9.3.0-8",
    "new.expensify@9.3.1-1",
    "new.expensify@9.3.2-2",
    "new.expensify@9.3.3-8",
    "new.expensify@9.3.4-6",
    "new.expensify@9.3.5-7",
    "new.expensify@9.3.6-4",
    "new.expensify@9.3.7-3",
    "new.expensify@9.3.8-3",
    "new.expensify@9.3.9-2",
    "new.expensify@9.3.10-6",
    "new.expensify@9.3.11-23",
    "new.expensify@9.3.11-43",
    "new.expensify@9.3.11-48",
    "new.expensify@9.3.12-1",
    "new.expensify@9.3.14-0",
    "new.expensify@9.3.15-1",
    "new.expensify@9.3.15-7",
    "new.expensify@9.3.15-10",
    "new.expensify@9.3.16-9",
    "new.expensify@9.3.17-6",
    "new.expensify@9.3.17-9",
    "new.expensify@9.3.18-2",
    "new.expensify@9.3.18-4",
    "new.expensify@9.3.18-5",
    "new.expensify@9.3.18-8",
    "new.expensify@9.3.19-3",
    "new.expensify@9.3.19-4",
    "new.expensify@9.3.19-5",
    "new.expensify@9.3.20-6",
    "new.expensify@9.3.21-4",
    "new.expensify@9.3.22-4",
    "new.expensify@9.3.23-3",
    "new.expensify@9.3.24-1",
    "new.expensify@9.3.24-3",
    "new.expensify@9.3.25-13",
    "new.expensify@9.3.26-8",
    "new.expensify@9.3.27-8",
    "new.expensify@9.3.29-0",
    "new.expensify@9.3.30-3",
    "new.expensify@9.3.31-12",
    "new.expensify@9.3.32-3",
    "new.expensify@9.3.33-5",
    "new.expensify@9.3.34-2",
    "new.expensify@9.3.35-1",
    "new.expensify@9.3.36-5",
    "new.expensify@9.3.36-6",
    "new.expensify@9.3.36-10",
    "new.expensify@9.3.37-10",
    "new.expensify@9.3.38-4",
    "new.expensify@9.3.39-3",
    "new.expensify@9.3.40-3",
    "new.expensify@9.3.40-4",
    "new.expensify@9.3.40-11",
    "new.expensify@9.3.41-0",
    "new.expensify@9.3.41-4",
    "new.expensify@9.3.42-3",
    "new.expensify@9.3.43-3",
    "new.expensify@9.3.46-0",
    "new.expensify@9.3.48-2",
    "new.expensify@9.3.49-2",
    "new.expensify@9.3.50-1",
    "new.expensify@9.3.50-2",
    "new.expensify@9.3.50-8",
    "new.expensify@9.3.51-10",
    "new.expensify@9.3.52-9",
    "new.expensify@9.3.53-7",
    "new.expensify@9.3.54-5",
    "new.expensify@9.3.54-7",
    "new.expensify@9.3.55-2",
    "new.expensify@9.3.56-0",
    "new.expensify@9.3.57-1",
    "new.expensify@9.3.58-4",
    "new.expensify@9.3.58-9",
    "new.expensify@9.3.59-3",
    "new.expensify@9.3.59-4",
    "new.expensify@9.3.60-17",
    "new.expensify@9.3.60-22",
    "new.expensify@9.3.61-4",
    "new.expensify@9.3.62-1",
    "new.expensify@9.3.62-3",
    "new.expensify@9.3.62-4",
    "new.expensify@9.3.62-5",
    "new.expensify@9.3.62-10",
    "new.expensify@9.3.62-13"
  ],
  "releaseRowsInWindow": 287,
  "metric": "Users with ≥1 error on a release strictly older than threshold / users with ≥1 error in window",
  "caveats": [
    "Based on Sentry error events, not all active users (silent users are excluded).",
    "Users who upgraded mid-window may appear on both old and new releases in the breakdown table; the headline % uses a deduplicated OR query when it fits in one chunk.",
    "If multiple OR chunks are required, uniqueUsersOnOlderReleases may over-count."
  ]
}

So I think we'll want to create an issue to remove these API endpoints soon, but we can't do it yet. @mountiny told me we're doing a forced-upgrade soon, so once we do that, we'll be able to remove them.

@roryabraham roryabraham Jun 18, 2026

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.

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

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
...mpanyCards/assignCard/TransactionStartDateStep.tsx 0.00% <0.00%> (ø)
... and 7 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor

Newest app version that called any of these endpoints: 9.3.63-0 — via OpenAssignFeedCardPage.

This PR removes 7 command definitions (src/libs/API/types.ts). I traced each command's last real call site (outside the enum definition) through git history and mapped the removal commit to the first release tag that contained it; the "last version that used it" is the tag immediately before that. At HEAD, none of the 7 have any remaining call site outside types.ts — they're genuinely unused.

Command Last version that called it Call site removed
OpenAssignFeedCardPage 9.3.63-0 ⟵ newest a601d1d1 (2026-04-19), src/libs/actions/CompanyCards.ts
OpenSidePanel 9.2.84-8 2663aaa9 (2025-12-05)
CloseSidePanel 9.2.84-8 2663aaa9 (2025-12-05)
CompleteConciergeCall 9.1.63-6 9a4e4e14 (2025-06-07)
ValidateLogin 9.1.29-10 355b4ab7 (2025-04-16)
RequestAccountValidationLink 9.1.29-10 355b4ab7 (2025-04-16)
OpenPersonalDetailsPage 1.4.61-8 bfd8fb98 (2024-04-05)

So the most recently-used of the batch, OpenAssignFeedCardPage, was last shipped with a call site in 9.3.63-0 (its single API.read(...) call in CompanyCards.ts was removed in a knip dead-code audit on 2026-04-19, first absent in 9.3.64-31). Everything else has been call-site-free for much longer.

⚠️ Server-side log check could not be run. The VictoriaLogs MCP integration isn't connected in this run, so I couldn't pull production traffic counts myself. The git history is conclusive that the client stopped sending these, but if you want to confirm no other clients (old app versions still in the wild, integrations, etc.) are still hitting them, run this in logSearch over the last 30 days:

{type=web} ("ValidateLogin" OR "RequestAccountValidationLink" OR "OpenSidePanel" OR "CloseSidePanel" OR "CompleteConciergeCall" OR "OpenPersonalDetailsPage" OR "OpenAssignFeedCardPage")

Since old app versions can linger in the wild, OpenAssignFeedCardPage (used as recently as 9.3.63-0) is the one most worth confirming has no residual traffic before this lands.

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

No product review needed

@joekaufmanexpensify
joekaufmanexpensify removed their request for review June 18, 2026 21:28
@mountiny

Copy link
Copy Markdown
Contributor

@shubham1206agra @QichenZhu What are the next steps on this PR?

@shubham1206agra

Copy link
Copy Markdown
Contributor Author

@QichenZhu will review this PR

Comment thread src/types/onyx/AssignCard.ts

@QichenZhu QichenZhu 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.

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
    https://expensify.slack.com/archives/C049HHMV9SM/p1778663561704459
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android-native.webm
Android: mWeb Chrome
android-web.webm
iOS: HybridApp
ios-native.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
assign-card.mov
mac-web.mov

@melvin-bot
melvin-bot Bot requested review from Julesssss and roryabraham June 22, 2026 12:22
@Julesssss
Julesssss merged commit aa08efd into Expensify:main Jun 22, 2026
35 of 42 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.17-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 I reviewed this PR against the help site files under docs/articles and no help site changes are required.

This is a pure internal code cleanup with no user-facing impact:

  • Removes unused API command definitions (e.g. ValidateLogin, OpenSidePanel/CloseSidePanel, CompleteConciergeCall, RequestAccountValidationLink, OpenPersonalDetailsPage, OpenAssignFeedCardPage) and their parameter files.
  • Removes unused Onyx FormIDs and TypeScript form types (AssignCardForm, MoneyRequestAmountForm, ProfileSettingsForm, RoomSettingsForm, SettingsStatusSetClearAfterForm).
  • A minor refactor in TransactionStartDateStep.tsx removing a redundant assignCard?.startDate fallback, and adding an internal errors field to the AssignCard type.

None of these touch a feature name, tab, setting, label, button, or workflow that the help site documents, so there's nothing to add or update and no draft PR was created.

shubham1206agra if you believe a specific user-facing behavior changed here that should be documented, let me know which flow and I'll take another look.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@shubham1206agra
shubham1206agra deleted the cleanup-formid-unused-apis branch July 7, 2026 10:56
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.

8 participants