Cleanup unused APIs and FormIDs definition - #93906
Conversation
|
@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] |
There was a problem hiding this comment.
@Julesssss @roryabraham You may need to remove exposure from BE side for these commands.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Newest app version that called any of these endpoints: This PR removes 7 command definitions (
So the most recently-used of the batch,
Since old app versions can linger in the wild, |
|
No product review needed |
|
@shubham1206agra @QichenZhu What are the next steps on this PR? |
|
@QichenZhu will review this PR |
QichenZhu
left a comment
There was a problem hiding this comment.
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 Issuessection 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
Testssection - I verified the steps for Staging and/or Production testing are in the
QA stepssection - 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 verified the steps for local testing are in the
- 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.
toggleReportand notonIconClick). - 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)
- 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.
- 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 usingAvatarhave 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
thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor) - Any internal methods bound to
thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick) - 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
Avataris modified, I verified thatAvataris 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
Designlabel and/or tagged@Expensify/designso 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
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - 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
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.17-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 I reviewed this PR against the help site files under This is a pure internal code cleanup with no user-facing impact:
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.
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
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
### 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.