Skip to content
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

[HOLD for payment 2023-05-16] [$1000] iOS - Chat - Can't download webp format image after it was upload to chat #16599

Closed
1 of 6 tasks
kbecciv opened this issue Mar 27, 2023 · 57 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Mar 27, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #16031

Action Performed:

  1. Open the app
  2. Login with any account
  3. Go to any chat
  4. Put on + button -> Add attachment -> send a webp format image as a file
  5. Open uploaded attachment -> download it

Expected Result:

An attachment is download

Actual Result:

Can't download attachment, an error appears

Workaround:

Unknown

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.2.90.4

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug5995126_RPReplay_Final1679945076__1_.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ce67f235c93f2d4c
  • Upwork Job ID: 1643450952704184320
  • Last Price Increase: 2023-04-19
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 27, 2023
@MelvinBot
Copy link

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

MelvinBot commented Mar 27, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@JmillsExpensify
Copy link

@youssef-lr I kind of wonder if we should put this issue on hold and handle it as part of supporting more file types, basically more formally than we do today? At the moment, I'm not really sure that this is technically a bug.

@melvin-bot melvin-bot bot added the Overdue label Mar 30, 2023
@MelvinBot
Copy link

@JmillsExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MelvinBot
Copy link

@JmillsExpensify Still overdue 6 days?! Let's take care of this!

@JmillsExpensify
Copy link

JmillsExpensify commented Apr 5, 2023

Ok coming back to this. I was able to successfully reproduce this. I would normally say we shouldn't bother, but we do officially support this file format, so I'm going to open this up for proposals.

@melvin-bot melvin-bot bot removed the Overdue label Apr 5, 2023
@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Apr 5, 2023
@melvin-bot melvin-bot bot changed the title iOS - Chat - Can't download webp format image after it was upload to chat [$1000] iOS - Chat - Can't download webp format image after it was upload to chat Apr 5, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01ce67f235c93f2d4c

@MelvinBot
Copy link

Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 5, 2023
@MelvinBot
Copy link

Triggered auto assignment to @marcochavezf (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@akinwale
Copy link
Contributor

akinwale commented Apr 5, 2023

I was unable to reproduce this on the latest main branch.

@hoangzinh
Copy link
Contributor

It seems it related to some IOS devices where it's not support webp

@akinwale
Copy link
Contributor

akinwale commented Apr 5, 2023

It seems it related to some IOS devices where it's not support webp

If this were the case, the image wouldn't have even displayed in the first place. webp images are not supported on iOS prior to v14.

@melvin-bot melvin-bot bot added the Overdue label Apr 7, 2023
@marcochavezf
Copy link
Contributor

@kbecciv could you try to reproduce this again? Seems this is no longer an issue (maybe was fixed recently?)

@melvin-bot melvin-bot bot removed the Overdue label Apr 7, 2023
@kbecciv
Copy link
Author

kbecciv commented Apr 7, 2023

@marcochavezf Let me check with QA team, will post you results shortly

@hellohublot
Copy link
Contributor

hellohublot commented Apr 9, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

iOS - Chat - Can't download webp format image after it was upload to chat

What is the root cause of that problem?

iOS cannot save webp photos

What changes do you think we should make in order to solve the problem?

iOS 14+ supports decoding webp images, But it still does not support saving webp to photo album, so we can save to File app, or we can save as jpg

Solution A - We do not perform format conversion, we can save it in the file app, but we may need to give the user a little hint to find it in the file app https://github.com/Expensify/App/blob/3abe7b2f9e38dba42edf406ca1b1e19087f5599d/src/libs/fileDownload/index.ios.js#L74-L75 ```javascript if (/\.webp$/.test(attachmentName)) { fileType = CONST.ATTACHMENT_FILE_TYPE.FILE } ... FileUtils.showSuccessAlert('you can find it in File app Expensify floder') ```

Solution B.

  • We can use the server to help us complete image format conversion, which requires the support of the back-end interface, the backend can add a format parameter to the image url and forward it to cloudfront
    const fileType = FileUtils.getFileType(fileUrl);
    const attachmentName = fileName || FileUtils.getAttachmentName(fileUrl);
if (/\.webp$/.test(attachmentName)) {
    fileUrl += '&format=jpeg'
}

Solution C.

} else if ([[inputURI.pathExtension lowercaseString] isEqualToString:@"webp"]) {
    NSData *data = [NSData dataWithContentsOfURL:inputURI];
    
    if ([[inputURI.pathExtension lowercaseString] isEqualToString:@"webp"]) {
          UIImage *webpImage;

          #ifdef SD_WEB_IMAGE_WEBP_CODER_AVAILABLE 
              // webp decoding
              webpImage = [[SDImageWebPCoder sharedCoder] decodedImageWithData:data options:nil];
          #else
              if (@available(iOS 14, *)) {
                    // webp decoding
                    webpImage = [UIImage imageWithData:data];
              }
          #endif
          
          // do format conversion
          if (webpImage) {
              data = UIImageJPEGRepresentation(webpImage, 1.0);
          }

    }
    UIImage *image = [UIImage imageWithData:data];
    assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
}

What alternative solutions did you explore? (Optional)

Not Yet

@melvin-bot melvin-bot bot added the Overdue label Apr 10, 2023
@MelvinBot
Copy link

@JmillsExpensify @marcochavezf @sobitneupane 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!

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 1, 2023
@MelvinBot
Copy link

Current assignee @marcochavezf is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 1, 2023
@MelvinBot
Copy link

📣 @hellohublot You have been assigned to this job by @marcochavezf!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@hellohublot hellohublot mentioned this issue May 2, 2023
57 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 2, 2023
@melvin-bot melvin-bot bot changed the title [$1000] iOS - Chat - Can't download webp format image after it was upload to chat [HOLD for payment 2023-05-16] [$1000] iOS - Chat - Can't download webp format image after it was upload to chat May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.12-0 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-05-16. 🎊

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 9, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 15, 2023
@sobitneupane
Copy link
Contributor

sobitneupane commented May 17, 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:

Issue not related to our App. Issue was existent on https://github.com/react-native-cameraroll/react-native-cameraroll and was solved by react-native-cameraroll/react-native-cameraroll#489

I don't think even regression test will be required.

@melvin-bot melvin-bot bot added the Overdue label May 19, 2023
@JmillsExpensify
Copy link

Alright, circling back on this issue. It looks like our payouts should be:

I've already invited Sobit. @hellohublot mind sharing your Upwork profile so I can hire you as well?

P.S. @sobitneupane I think this approach sounds reasonable.

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@hellohublot
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label May 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

@JmillsExpensify, @marcochavezf, @hellohublot, @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot
Copy link

melvin-bot bot commented May 30, 2023

@JmillsExpensify, @marcochavezf, @hellohublot, @sobitneupane Still overdue 6 days?! Let's take care of this!

@JmillsExpensify
Copy link

Apologies for the delay guys. I went OOO and I'm just coming back. I'm closing the loop on the payments now.

@melvin-bot melvin-bot bot removed the Overdue label May 31, 2023
@JmillsExpensify
Copy link

@sobitneupane has been paid out and I just invited @hellohublot. As soon as you're able to answer the invite, I'll issue contract, payment and bonus. Thanks!

@JmillsExpensify
Copy link

Thanks for the quick response. Everyone should have been paid out now and now regression tests are outstanding. I'm closing this one out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants