-
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
Prevent crash after interacting with reaction tooltip #18037
Conversation
@s77rt @hayata-suenaga One of you needs to 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] |
Yeah I saw this on |
@marcaaron I can't reproduce the bug on BTW, the idea for the fix here is to add a fallback |
I did check. Though, what about this PR could be affecting the styles? 🤔 @hayata-suenaga would you maybe like to be a 3rd party and help us test here?
It's the material change that fixes the crash. Though, I might be misunderstanding the comment about "polish". There were several things being done wrong and we fixed them, no?
Honestly, I'm open to ideas here, but can't really think of what the alternative would be. Let's hear the suggestions if you've got them 😄
I'm not sure if it's a clearly defined problem. What are these "many components"? Which data is changing? What's the alternative? |
Maybe it is fixed. I will try merging |
Hmm what's weird is that switching away from the browser and switching back will fix this. 🤷♂️ pretty stumped about it. |
Can you please explain that? I think the crash is happening because on logout the |
@marcaaron could you kindly tell me which line of code was causing the crash? I assume somewhere that was trying to access a property of a user information that doesn't exist?
so before the authentication state from the Onyx SESSION data changes and the screen being display switches here, the user information on Onyx changes first and that causes re-renders of the current child components? if this is the case, as @s77rt suggested here we might have several components where this same kind problem already exists |
Sorry, I'm not sure what needs explaining. The cause of the crash is because we were casting an |
I think the problem is not very complex tbh. We should not be trying to access values that are WRT Onyx, yeah, we need to use a default value in most cases so I added one here. The value could not exist, it could be removed, etc. We must write code that guards against it somehow. Anyways, I am open to suggestions. But if we are asking solve a problem that "might exist" then I will ask to first fix the problem that exists right now while we think about the better way. |
@marcaaron Can you please fix the reported bug here #18037 (comment) |
Yes I agree. Let's fix problems as they arise. I think when we migrate the codebase to Typescript, we can avoid most of this type of bugs. |
I'm not seeing what would cause it. Do you have any ideas? |
Checking... |
The problem is the swap of
This does not happen with |
Ugh! Nice spot @s77rt - I could not see it at all... I think if we just pass the |
Updated. Thanks for the push @s77rt ! |
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - ChromeMobile Web - SafariDesktopdesktop.mp4iOSAndroid |
Thanks @marcaaron and @hayata-suenaga. Let's get this merged. |
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.
LGTM! 🚀
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.
LGTM!
there is a merge conflict |
Updated. |
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.
LGTM
Wait a sec |
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.
diff --git a/src/components/Reactions/ReportActionItemReactions.js b/src/components/Reactions/ReportActionItemReactions.js
index 5cb2d5d6ad..948a01d50b 100644
--- a/src/components/Reactions/ReportActionItemReactions.js
+++ b/src/components/Reactions/ReportActionItemReactions.js
@@ -84,7 +84,7 @@ const ReportActionItemReactions = (props) => {
props.toggleReaction(emoji);
};
const onReactionListOpen = (event) => {
- const users = PersonalDetailsUtils.getPersonalDetailsByIDs(reactionUsers);
+ const users = PersonalDetailsUtils.getPersonalDetailsByIDs(reactionUsers, props.currentUserPersonalDetails.accountID);
ReactionList.showReactionList(event, popoverReactionListAnchor.current, users, reaction.emoji, emojiCodes, reactionCount, hasUserReacted);
};
We added another call to PersonalDetailsUtils.getPersonalDetailsByIDs
just recently by #15685.
That was a close one 😅
PLEASE GODS LET ME MERGE THE PR 🙀 🙏 😂 |
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.
Let's merge this 🚀!
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.
sorry for the delay!
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.13-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.13-5 🚀
|
Details
withCurrentUserPersonalDetails
accountID
to the current user personal details HOC as a convenienceReactionTooltipContent
emojiFixed Issues
$ #18034
Tests
NOTE: Tooltips don't exist on native so we can skip tests on all platforms besides web and desktop.
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.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
Web
Desktop