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
[HOLD for payment 2023-10-09] [$500] A new tab opens when downloading offline #26258
Be offline for user B before opening the attachment
Click on the attachment sent from User A
Click on the download button at the top
Expected Result:
the inactive download button is shown.
Actual Result:
A new tab is opened
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?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.58-0 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
Hello, my idea is to make the download button inactive when the user is offline. We could make an event listener when the pop-up is injected in the code to get the network status of the user.
📣 @jjmilad! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
I'm able to reproduce. If we're able to download the attachment then we should. If not, then we'd want to somehow tell the user they need to go online to access the attachment.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
[@fedirjh] 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:
[@fedirjh] 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:
[@fedirjh] Determine if we should create a regression test for this bug.
[@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@tjferriss] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
@tjferriss I am afraid to let you know that My Upwork account is suspended so I couldn't get paid with my account. May I send proposal with my friend's account?
Activity
melvin-bot commentedon Aug 29, 2023
Triggered auto assignment to @tjferriss (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 29, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jjmilad commentedon Aug 29, 2023
Hello, my idea is to make the download button inactive when the user is offline. We could make an event listener when the pop-up is injected in the code to get the network status of the user.
melvin-bot commentedon Aug 29, 2023
📣 @jjmilad! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
Krishna2323 commentedon Aug 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
A new tab opens when downloading offline
What is the root cause of that problem?
Download button is not hidden & we open external link of the attachment when download fails.
App/src/libs/fileDownload/index.js
Lines 40 to 44 in 10ad0cb
What changes do you think we should make in order to solve the problem?
We can hide or disable the download button when user is offline, using isOffline state.
const {isOffline} = useNetwork();App/src/components/AttachmentModal.js
Line 342 in 6e17b64
And update this line to:
shouldShowDownloadButton={props.allowDownload && shouldShowDownloadButton && !isOffline}Result:
Monosnap.screencast.2023-08-30.17-55-58.mp4
paultsimura commentedon Aug 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user is offline, the "Download Attachment" button should be disabled instead of opening a new tab.
What is the root cause of that problem?
We do not handle the user's network status.
What changes do you think we should make in order to solve the problem?
For
HeaderWithBackButton, along withshouldShowDownloadButton, add a boolean propertyshouldDisableDownloadButtonApp/src/components/HeaderWithBackButton/headerWithBackButtonPropTypes.js
Line 29 in 6e17b64
In
HeaderWithBackButton, while rendering thePressableWithoutFeedback, pass thedisabledproperty:App/src/components/HeaderWithBackButton/index.js
Line 95 in 6e17b64
withNetwork()and render<HeaderWithBackButton>withshouldDisableDownloadButton={props.network.isOffline}download-button-disabled.mov
What alternative solutions did you explore? (Optional)
yh-0218 commentedon Aug 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user is offline, the "Download Attachment" button should be disabled instead of opening a new tab.
What is the root cause of that problem?
We do not handle the user's network status.
But this is not correct problem.
We have to allow user to download images that he received before.
What changes do you think we should make in order to solve the problem?
add a boolean property
shouldDisableDownloadButtonundershouldShowDownloadButtononHeaderWithBackButtonApp/src/components/HeaderWithBackButton/headerWithBackButtonPropTypes.js
Line 29 in 6e17b64
On
HeaderWithBackButton, we need to addPressableWithoutFeedbackas disableApp/src/components/HeaderWithBackButton/index.js
Line 95 in 6e17b64
Need to add this code to under components
App/src/components/AttachmentModal.js
Line 339 in 4675db5
What alternative solutions did you explore? (Optional)
melvin-bot commentedon Sep 4, 2023
@tjferriss Eep! 4 days overdue now. Issues have feelings too...
tjferriss commentedon Sep 5, 2023
I'm able to reproduce. If we're able to download the attachment then we should. If not, then we'd want to somehow tell the user they need to go online to access the attachment.
47 remaining items
melvin-bot commentedon Oct 2, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Oct 2, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
tjferriss commentedon Oct 3, 2023
Payment summary:
Eligible for 50% speed bonus
StevenKKC commentedon Oct 3, 2023
@tjferriss I am afraid to let you know that My Upwork account is suspended so I couldn't get paid with my account. May I send proposal with my friend's account?
tjferriss commentedon Oct 3, 2023
@StevenKKC that's fine. They can apply for the posting here: https://www.upwork.com/jobs/~0159b5b921ce8fa955.
Please comment here with their name once they've applied.
StevenKKC commentedon Oct 4, 2023
Thank you @tjferriss I submit proposal with my friend's account.
This is profile link: https://www.upwork.com/freelancers/~0188155b8a5d85a491
tjferriss commentedon Oct 5, 2023
@StevenKKC I just sent an offer to your friend.
fedirjh commentedon Oct 9, 2023
BugZero Checklist:
Regression Test Proposal
tjferriss commentedon Oct 11, 2023
All payments have been sent via Upworks and the regression test has been proposed.