Disable logs for staging and production native apps#30875
Conversation
There was a problem hiding this comment.
I've included these logs, because I've found out that when we're building the production web release, the environment output is development, which is why the webpack configuration above never used the env.production path
There was a problem hiding this comment.
- The
env.productionpath were never engaged for web builds. The reason being,NODE_ENVisn't defined before initiating the build process. - I'm omitting the 'transform-remove-console' plugin. Our intent is to retain console logs for web/desktop in production builds.
In essence, this modification aligns the dev and prod configurations, making them the same, hence the presented code change.
|
@robertKozik 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] |
12c9100 to
9579930
Compare
| env: { | ||
| production: { | ||
| plugins: ['transform-remove-console', {exclude: ['error', 'warn']}], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
I think we should preserve, the error and warn logs, because they aren't used frequently to impact the UX
That's why I've opted to keep them (exclude them from removal) here
|
How is the app reporting errors and crashes? Usually, the library of choice has a way to not completely disable logs but rather buffer them and choose a transport. By transport, you can then choose console output or Sentry or w/e. |
I believe the current setup uses Firebase Crashlytics to capture crashes and errors As for log transport, Expensify employs its proprietary logging library that transmits logs to the backend. In this PR, our primary objective is to cease the echoing of these logs on the client device without affecting the backend transmission. |
Reviewer Checklist
Screenshots/Videos |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.96-6 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.98-0 🚀
|
|
Asked about QA in slack |
This PR is focused on performance optimization and doesn't introduce new features or bug fixes. Therefore, it might not require the usual QA procedures. However, I suggest the following:
I'm not familiar with the QA process, so if this approach isn't suitable or if performance gains aren't easily measurable, I understand that a standard QA might not be applicable here. |
|
The QA can be done in production too, we just need to check if there are no logs in server from the native apps. |
|
I think I have confirmed this works in staging, I did not log any push notifications received since this was deployed https://www.expensify.com/_devportal/tools/logSearch/#sort=asc&size=10000&query=blob%3A%22%5BPushNotification%5D%20push%20notification%20received%22%20AND%20email%3A%22vit%40expensify.com%22%20AND%20timestamp%3A%5B2023-11-09T00%3A00%20TO%202023-11-15T23%3A59%5D |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.98-5 🚀
|







Details
errorandwarnlogs.webpackpresets and plugins.Fixed Issues
$ #30571
PROPOSAL: #30571 (comment)
Tests
For Mobile Native Apps (Android/iOS):
npm run androidnpm run iosDEVmode is activated:Din the terminal running the metro server.Settingsin the dev menu and ensure "JS DEV Mode" is checked.DEVmode and refresh the app by pressingrin the terminal running the metro server.For Web / mWeb / Desktop:
npm run webnpm run desktopnpm run buildand review the generated output in thedistdirectory.dist/main-{hash}.js. Searching forconsole.debugshould yield more than 30 matches.Backend check
Ensure logs are still being sent to the backend.
Monitor Network Activity:
https://www.expensify.com/api?command=Log.Backend Logs Verification (For Authorized Personnel):
Offline tests
N/A: The changes are exclusive to the build process.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Dev with debug logs
Prod no debug logs
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop