Closed youssef-lr closed 1 month ago
Job added to Upwork: https://www.upwork.com/jobs/~01b447136e274124b6
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (External
)
Triggered auto assignment to @puneetlath (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Please re-state the problem that we are trying to solve in this issue. Investigate the console errors that show up after signing in
What is the root cause of that problem? 1.the View components may have plain text is directly inside them will check Wrap all text with Text components. 2.some libraries are using deprecated methods like findDOMNode will check and update them What changes do you think we should make in order to solve the problem?
Hi @mosesbabu can you format your proposal same as PROPOSAL_TEMPLATE here? Besides that, the root cause needs to be more details and clearly point out which is causing the issue. Thank you.
ok noted doing so right now. was asking if the issue is not yet assigned as well thank you
yep, it is still open for proposals
i recreated the error locally there are more errors as well on the console apart from these can check them as well
Investigate the console errors that show up after signing in
The RCA was not how react handled the routes but this is fixed
Verify that objects from which are reading properties are not undefined. Add null or undefined checks before accessing properties Ensure findDOMNode is not used directly. Update any libraries that rely on findDOMNode to their latest versions
there are so many other errors i can clear them all if hired
It looks better @mosesbabu, but next time, you don't need to post a new proposal, just update the existing one.
This error occurs when trying to access the routes property of an undefined object.
Can you elaborate more on it in your RCA? Which line of code caused this error? How can it happen? In RCA, we have to describe the root cause in detail as much as possible.
@puneetlath, @hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick!
@mosesbabu is your proposal ready for the next review? If yes, please post a new comment according to step 7 of the guidelines https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#propose-a-solution-for-the-job
Yes it's ready for review apologies this is my first time with expensify am I supposed to first fix the error or wait to be hired first
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
No worry @mosesbabu.
caused by findDomNode being depreciated in StrictMode
Your RCA is still not clear to me. Can you point out exactly which line of codes in Expensify/App repo or libraries that cause this error? Thank you.
@hoangzinh The findDOMNode being depreciated error arises from this specific library is react-native-gesture-handler library in react not anywhere in the code as app is running on strictMode shows that its depreciated to fix is by using refs in componetts raising the error example component is :src/components/Pressable/GenericPressable/BaseGenericPressable.tsx however a depreciated warning doesnt keep app from running
to fix is by using refs in componetts raising the error example component is :src/components/Pressable/GenericPressable/BaseGenericPressable.tsx
Cool. Can you share more details on how you would fix it in the BaseGenericPressable
component?
A few console error.
If we look at the video play() error stacktrace image, we can see that it's coming from the onboarding video. If you open /onboarding/welcome-video, then you will all the errors + other errors that doesn't show in the OP, except the routes
error (the routes
error only show when loggin in). Here is the explanation of each error:
Warning: findDOMNode is deprecated in StrictMode This error comes from react-native-gesture-handler and needs to be fixed on the upstream repo.
Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code This error comes from react-native-animatable and needs to be fixed on the upstream repo.
TypeError: Cannot read properties of undefined (reading 'routes') The getState() in resetHomeRouteParams is undefined. https://github.com/Expensify/App/blob/d8d7f7887ea28c70ba71a06be87fcacd2436e2bc/src/libs/actions/Session/index.ts#L678-L680
We previously have this kind of issue too in https://github.com/Expensify/App/pull/37194.
Unexpected text node.
This means there is a text rendered without a <Text>
component. This erro comesfrom FeatureTrainingModal where we conditionally render a component based on a string value, but if it's empty, then ''
is rendered.
https://github.com/Expensify/App/blob/6fcca3c2c941fb85761ee88568a5b17e040b8140/src/components/FeatureTrainingModal.tsx#L218-L225
validateDOMNesting(...):
The code above is to fix https://github.com/Expensify/App/issues/36906.
We mute the volume here initially, but not immediately. https://github.com/Expensify/App/blob/6fcca3c2c941fb85761ee88568a5b17e040b8140/src/components/VideoPlayerContexts/VolumeContext.tsx#L11-L32
currentReportID
is changed from an empty string to the topmost reportID that triggers resetVideoPlayerData()
which calls stopVideo()
.https://github.com/Expensify/App/blob/00d2c42b4a1d53696e4cb0808ba31fc10028ffcd/src/components/VideoPlayerContexts/PlaybackContext.tsx#L85-L90 https://github.com/Expensify/App/blob/00d2c42b4a1d53696e4cb0808ba31fc10028ffcd/src/components/VideoPlayerContexts/PlaybackContext.tsx#L75-L77
Add null safety when accessing the state
const routes = navigationRef.current?.getState()?.routes;
Use !!
to check the text.
{!!title && !!description && <.../>}
...
{!!helpText && <.../>}
Remove the accessibilityRole so it's rendered as a div https://github.com/Expensify/App/blob/6fcca3c2c941fb85761ee88568a5b17e040b8140/src/components/VideoPlayer/BaseVideoPlayer.tsx#L299-L300
Immediately mute the video when mounted in BaseVideoPlayer
useEffect(() => {
videoPlayerRef.current?.setStatusAsync({volume: 0});
}, []);
Two ways to solve this. First, only stop the video if the video is playing.
checkVideoPlaying((isPlaying) => {
videoResumeTryNumberRef.current = 0;
if (isPlaying) {
stopVideo();
}
setCurrentlyPlayingURL(null);
... // rest
});
Or, store the previous currentReportID
const prevCurrentReportID = usePrevious(currentReportID);
and don't call resetVideoPlayerData
if the prevCurrentReportID
is empty. This way, if the currentReportID
is set for the first time, we won't call resetVideoPlayerData
and it will only be called if the currentReportID
is really changed (instead of being triggered from empty string to the topmost report ID).
if (!currentReportID || !prevCurrentReportID) {
return;
}
resetVideoPlayerData();
Thoughts @hoangzinh?
@puneetlath, @hoangzinh Huh... This is 4 days overdue. Who can take care of this?
Hi @puneetlath, the first 2 warnings in RCA of @bernhardoj's proposal https://github.com/Expensify/App/issues/45619#issuecomment-2255682959 they're only in strict mode and need to be fixed in upstream repos (Warning: findDOMNode and Warning: Using UNSAFE_componentWillReceiveProps). Do you think we should fix it or can leave it there?
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@bernhardoj
- Immediately mute the video when mounted
I tried to apply your suggestion but it didn't work. Can you share exactly the component/where we should set mute for the player?
- The play() request was interrupted by a call to pause().
I couldn't reproduce this error. Are you still able to reproduce it?
@puneetlath @hoangzinh this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
I tried to apply your suggestion but it didn't work. Can you share exactly the component/where we should set mute for the player?
You can put the code in BaseVideoPlayer. I have added this info to my proposal.
I couldn't reproduce this error. Are you still able to reproduce it?
After retesting, the app is lagging before the video shows and I can't reproduce it. But after muting the video immediately, the app runs smoother and I can reproduce the issue again.
Oh, you're right. Let's wait for @puneetlath thoughts on https://github.com/Expensify/App/issues/45619#issuecomment-2260852821
Let's focus on fixing the ones that can be handled on our side for now in this issue.
Thanks @puneetlath. @bernhardoj proposal looks good to me.
Link to proposal https://github.com/Expensify/App/issues/45619#issuecomment-2255682959
πππ C+ reviewed
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
π£ @hoangzinh π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
PR is ready
cc: @hoangzinh
This issue has not been updated in over 15 days. @puneetlath, @hoangzinh, @bernhardoj eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
I think we're good to pay this one out. @hoangzinh can you complete the checklist?
Sure, I will complete the checklist today
Console error 3rd: TypeError: Cannot read properties of undefined (reading 'routes') Console error 4th: Unexpected text node Console error 5th: validateDOMNesting(...): cannot appear as a descendant of Console error 6th: play() failed because the user didn't interact with the document first Console error 7th: The play() request was interrupted by a call to pause()
I think we're good to pay this one out. @hoangzinh can you complete the checklist?
BZ checklist is complete , @puneetlath
Payment summary:
Thanks everyone!
Requested in ND.
$250 approved for @bernhardoj
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: Reproducible in staging?: Reproducible in production?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Slack conversation:
Action Performed:
Expected Result:
Ideally, no error should be shown in the console.
Actual Result:
Many console errors show up and they are distracting, it's hard to know which one of them is causing a UI issue.
As of now here are the errors I'm seeing:
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @hoangzinh