You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Split - App crashes when tapping Copy to clipboard on code block context menu #47743
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Version Number: 9.0.22-7 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):applausetester+kh050806@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Launch New Expensify app
Go to group chat
Tap + > Spli expense > Manual
Create a split manual expense with code block as the description
Tap on the split preview
Long press on the code block
Tap Copy to clipboard
Expected Result:
App will not crash
Actual Result:
App crashes when tapping Copy to clipboard on code block context menu in split menu
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@kevinksullivan FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
What changes do you think we should make in order to solve the problem?
We should not call showContextMenuForReport when report or action is undefined. The check can be added before calling showContextMenuForReport or here.
We should also check other html renderers with same bug.
What alternative solutions did you explore? (Optional)
When report or action is not present, we can render TDefaultRenderer without PressableWithoutFeedback.
we must not allow user to open context menu type REPORT_ACTION by long pressing on the description field. Because they only can open context menu type REPORT_ACTION by long pressing on the report action.
was initially added in this PR to ensure that long-pressing on a link or email triggers context menu type LINK or EMAIL. However, this is redundant because if an email or link is wrapped in a code block like:
abcdef@gmail.com
or
https://dev.new.expensify.com:8082/
They are displayed as code, not as an active email or link. Therefore, long-pressing on them should not trigger the context menu type LINK or EMAIL.
So the solution is just need to remove the above onLongPress.
What alternative solutions did you explore? (Optional)
In ShowContextMenuContext, we can introduce a new value in its context value, named canOpenContextMenu and its default value is false.
changed the title [-]Split - App crashes when tapping Copy to clipboard on code block context menu[/-][+][$250] Split - App crashes when tapping Copy to clipboard on code block context menu[/+]on Aug 24, 2024
The PR that introduced the bug has been identified. Link to the PR: Nope, I think it's just a new edge case that we haven't covered.
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug: 🚫 It's just an edge case UI issue. We don't need a regression test for it.
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Aug 20, 2024
Triggered auto assignment to @kevinksullivan (
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.lanitochka17 commentedon Aug 20, 2024
@kevinksullivan FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
lanitochka17 commentedon Aug 20, 2024
We think that this bug might be related to #vip-split
Krishna2323 commentedon Aug 20, 2024
Edited by proposal-police: This proposal was edited at 2024-08-20 19:46:28 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Split - App crashes when tapping Copy to clipboard on code block context menu
What is the root cause of that problem?
Context menu is not disabled when
actionandreportare undefined.App/src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.tsx
Lines 42 to 44 in dd32073
What changes do you think we should make in order to solve the problem?
showContextMenuForReportwhenreportoractionis undefined. The check can be added before callingshowContextMenuForReportor here.What alternative solutions did you explore? (Optional)
When report or action is not present, we can render
TDefaultRendererwithoutPressableWithoutFeedback.Result
daledah commentedon Aug 21, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
A long press on the description field show the context menu actions.
What is the root cause of that problem?
The code block is displayed as the
pretag:App/src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.tsx
Line 29 in dd32073
When long pressing on it, we will call:
App/src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.tsx
Line 43 in dd32073
There is the case the report or action data is undefined, because there is no
ShowContextMenuContext.Providerwrapped in it, this issue for example.As a result, call any context menu action, such as "Copy to clipboard" will throw the error "Cannot read properties of null (reading 'actionName')".
What changes do you think we should make in order to solve the problem?
we must not allow user to open context menu type
REPORT_ACTIONby long pressing on the description field. Because they only can open context menu typeREPORT_ACTIONby long pressing on the report action.onLongPressin:App/src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.tsx
Lines 42 to 44 in dd32073
was initially added in this PR to ensure that long-pressing on a link or email triggers context menu type
LINKorEMAIL. However, this is redundant because if an email or link is wrapped in a code block like:or
They are displayed as code, not as an active email or link. Therefore, long-pressing on them should not trigger the context menu type
LINKorEMAIL.onLongPress.What alternative solutions did you explore? (Optional)
In
ShowContextMenuContext, we can introduce a new value in its context value, namedcanOpenContextMenuand its default value isfalse.So this:
App/src/components/HTMLEngineProvider/HTMLRenderers/PreRenderer.tsx
Lines 42 to 44 in dd32073
will be:
and just pass
canOpenContextMenu: truein where in need through theShowContextMenuContext.provider.wildan-m commentedon Aug 21, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Context menu shown in code block in menu item
What is the root cause of that problem?
The context menu shouldn't be shown in codeblock in menu item
What changes do you think we should make in order to solve the problem?
If codeblocks are unnecessary in the menu item description, we can remove the shouldParseTitle parameter from MenuItemWithTopDescription.
src/components/ReportActionItem/MoneyRequestView.tsx (or other similar parts)
What alternative solutions did you explore? (Optional)
N/A
[-]Split - App crashes when tapping Copy to clipboard on code block context menu[/-][+][$250] Split - App crashes when tapping Copy to clipboard on code block context menu[/+]melvin-bot commentedon Aug 24, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01a78f1cc82b94611b
melvin-bot commentedon Aug 24, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh (
External)46 remaining items
melvin-bot commentedon Sep 24, 2024
@hoangzinh, @lakchote, @kevinksullivan, @isabelastisser, @daledah 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
hoangzinh commentedon Sep 25, 2024
PR has been deployed to staging. Awaiting for testing
hoangzinh commentedon Sep 25, 2024
@lakchote @isabelastisser can you help to add the "Weekly" label back for this issue? It seems to be reverted to "Daily"
lakchote commentedon Sep 25, 2024
Done.
hoangzinh commentedon Oct 18, 2024
BugZero Checklist:
hoangzinh commentedon Oct 18, 2024
cc @isabelastisser this issue is ready for payment
isabelastisser commentedon Oct 22, 2024
@hoangzinh, I processed your payment in Upwork.
@daledah, please share your Upwork profile, thanks!
daledah commentedon Oct 29, 2024
@isabelastisser Here you go https://www.upwork.com/freelancers/~0138d999529f34d33f
isabelastisser commentedon Nov 5, 2024
@daledah, thanks! I sent you the offer in Upwork now. All set!
daledah commentedon Nov 6, 2024
@isabelastisser Many thanks, offer accepted.