-
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
[$2000] Chat - Deleted image URL crashes the app on mac and windows (works fine on mobile) #22261
Comments
Triggered auto assignment to @twisterdotcom ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Deleted image URL crashes the app on mac and windows What is the root cause of that problem?when attachment not found we throw js error instead of handling the error with UI. App/src/components/AttachmentCarousel/index.js Lines 187 to 190 in f9a8529
What changes do you think we should make in order to solve the problem?
// this.props.onNavigate(attachments[page]);
if(page !== -1){
this.props.onNavigate(attachments[page]);
}
// in AttachmentCarousel
this.props.hideDownloadButton(page === -1);
// in AttachmentModal
const [shouldShowDownloadButton, setShouldShowDownloadButton] = React.useState(true);
const hideDownloadButton = useCallback((shouldHide) => {
setShouldShowDownloadButton(!shouldHide);
}, []);
shouldShowDownloadButton={props.allowDownload && shouldShowDownloadButton}
//wrap content with
<FullPageNotFoundView
shouldShow={this.state.page === -1}
...
/>
...
</FullPageNotFoundView>
<BlockingView
icon={Illustrations.ToddBehindCloud}
iconWidth={variables.modalTopIconWidth}
iconHeight={variables.modalTopIconHeight}
title={props.translate('notFound.notHere')}
subtitle={props.translate('notFound.pageNotFound')}
/> What alternative solutions did you explore? (Optional)instead we can fix it in shouldShowDownloadButton={props.allowDownload && !fileNotFound}
!fileNotFound ? <AttachmentCarousel/> : <BlockingView/> and used the same way here to check if file found or not. |
ProposalPlease re-state the problem that we are trying to solve in this issue.A deleted image crashes the app on Mac and Windows when viewed. What is the root cause of that problem?If the image is not found when setting the initial state of the App/src/components/AttachmentCarousel/index.js Lines 187 to 202 in f9a8529
What changes do you think we should make in order to solve the problem?Not found images should be handled gracefully. First, we must remove the thrown error and instead we normally return the state. This is a slightly more elegant approach than the previously proposed change as this results in no duplicate code: const page = _.findIndex(attachments, (a) => a.source === this.props.source);
if (page > -1) {
// Update the parent modal's state with the source and name from the mapped attachments
this.props.onNavigate(attachments[page]);
}
return {
page,
attachments,
shouldShowArrow: this.canUseTouchScreen,
containerWidth: 0,
isZoomed: false,
activeSource: null,
}; Secondly, the We should define a translations key for a more specific error message than This should hide the following component, as it is redundant here:
Lastly, the download button should be removed in the case of an error. To achieve this, we can create and pass an This should then be used to conditionally hide the download button: shouldShowDownloadButton={props.allowDownload && !state.hasAttachmentError} App/src/components/AttachmentModal.js Lines 290 to 307 in e753f4d
What alternative solutions did you explore? (Optional)N/A |
@twisterdotcom Huh... This is 4 days overdue. Who can take care of this? |
Job added to Upwork: https://www.upwork.com/jobs/~0113703c85388c5be7 |
Current assignee @twisterdotcom is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
@mananjadhav - Looks like we have a few proposals here that might work. |
Checking those today. |
Bump @mananjadhav. I'll reassign to another on Wednesday to give you some time. If you're a bit busy, don't worry, somebody else will surely pick it up! |
@twisterdotcom Thanks for the bump. I reviewed the proposals, and both have the correct RCA. I just need to verify the pros and cons of both. I'll have that confirmed by tomorrow. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Thanks for the patience here. Apologies folks, it takes time when we have similar proposals with edited history. I think @ahmedGaber93's proposal covered most expects from the beginning and hence we should be using their proposal. 🎀 👀 🎀 C+ reviewed. |
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Thanks for the review @mananjadhav, assigning @ahmedGaber93 🚀 |
I am also not aware of that, but we already use
and we can simplify it to // replace this !_.find(initialState.attachments, (a) => a.source === props.source
// with initialState.page === -1
// it calculate in createInitialState no need to calculate it again
if(_.find(attachments, (a) => a.source === props.source) && initialState.page === -1)) {
// it found in oldState
// _.find(attachments, (a) => a.source === props.source)
// it not found in newState
// initialState.page === -1 |
Okay this makes sense, but better to also add @marcochavezf I think the updated proposal looks good here. @marcochavezf @twisterdotcom -
I think this counts for increase in the bounty. |
I am happy to increase to 2000 for the increased work. Can we retain @ahmedGaber93 as the assignee for this? |
Upwork job price has been updated to $2000 |
Thanks @twisterdotcom. Yes we can retain @ahmedGaber93. |
I was away for the weekend, and I'll be reviewing this tomorrow. |
We're again blocked by conflicts causing additional changes. @ahmedGaber93 is working through it. |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
Apologies but I am finally going on Parental Leave. I am reassigning to another member of the team. |
Triggered auto assignment to @mallenexpensify ( |
This was deployed on production 2 days back but the title wasn't updated. |
@mallenexpensify Can you post the payout summary? This is in production for 7 days, but the title wasn't updated. |
The But I do think we should add regression test as it involves App crash. The test steps from the PR are good for the regression steps here. wdyt @marcochavezf @mallenexpensify ? @mallenexpensify quick bump on the previous comment for the payout summary. |
@dhanashree-sawant can you please accept the job and reply here once you have? For issue payment, I see TestRail GH created https://github.com/Expensify/Expensify/issues/313988 @twisterdotcom I'm off this week, can you please keep 👀 on this then I'll snag it back on Monday? Thx |
@mallenexpensify the scope of the issue was changed multiple times. Hence we increased the bounty to 2000. I don't think there would be any penalty here, and also no timeline bonus. |
Thanks @mananjadhav Issue reporter: @dhanashree-sawant paid $250 via Upwork Closing.. I think we got everything.. right? |
@mallenexpensify I think this needs to be opened until @JmillsExpensify approves it on NewDot. |
It shouldn't need to, but I'll reopen, assign to Mills and let him close again. Per the internal StackOverflow post
|
Okay in previous issues I've seen issues kept open. Waiting for @JmillsExpensify to process this one though. |
$2,000 payment approved via NewDot based on BZ summary. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App should display 'Hmm its not here' page when we open link of delete image like it does on android chrome
Actual Result:
App crashes when we open link of delete image
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.36-4
Reproducible in staging?: y
Reproducible in production?: y
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
Notes/Photos/Videos: Any additional supporting documentation
app.crash.deleted.image.url.mp4
Recording.3425.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688488679783719
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: