-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Uncaught (in promise) TypeError in Timing.ts #33327
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2023-12-20.at.5.59.54.AM.moviOS: NativeScreen.Recording.2023-12-20.at.1.56.30.PM.moviOS: mWeb SafariScreen.Recording.2023-12-20.at.6.32.59.AM.movMacOS: Chrome / SafariScreen.Recording.2023-12-20.at.5.17.05.AM.movMacOS: DesktopScreen.Recording.2023-12-20.at.5.19.49.AM.mov |
@@ -39,8 +39,8 @@ function end(eventName: string, secondaryName = '', maxExecutionTime = 0) { | |||
return; | |||
} | |||
|
|||
const {startTime, shouldUseFirebase} = timestampData[eventName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... What if timestampData[eventName]
is undefined
? We'll still get an error here. Can't we just do:
const {startTime, shouldUseFirebase} = timestampData[eventName] || {};
instead inside the callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, we need to set a default value for startTime
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah I thought the same but we're already checking if the value exists in the condition above, also we're substracting startTime
below which also won't be ideal. timestampData[eventName]
exists but it's deleted in another .end call
@marcochavezf On iOS, I'm still getting the following: Screen.Recording.2023-12-20.at.6.43.55.AM.mov |
@allroundexperts that's unrelated to this issue, thanks for checking though! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. My Android build is having some issues so I've skipped the screenshots for Android native. Since this is a deploy blocker, I'm approving so that its not blocked.
@arosiclair 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] |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Fix Uncaught (in promise) TypeError in Timing.ts (cherry picked from commit f33d674)
🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 1.4.14-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.4.14-6 🚀
|
Details
We're deleting the value of
timestampData[eventName]
asynchronously for the eventchat_render
and when we enter in thegetEnvironment
callback the value doesn't exist. In this PR we're just getting the values before entering the callback.Fixed Issues
$ #33290
Tests
Uncaught (in promise) TypeError
in the console logOffline tests
N/A
QA Steps
Same test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop