Skip to content

[$250] Web - Attachment - Attached long image can be briefly opened in full resolution #47646

Closed

Description

@IuliiaHerets

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


Version Number: v9.0.22-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with any account
  3. Open any 1:1 chat
  4. Send the attached long image to the chat
  5. Quickly open it after it appeared in the chat
  6. Zoom in
  7. Open the image again after it's closed

Expected Result:

The low resolution image should open for the first time.

Actual Result:

Attached long image can be briefly opened in full resolution.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6575727_1724046651606.bandicam_2024-08-19_07-44-40-640.mp4

Bug6575727_1724046927643!bigggg (1)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013a2a8877c3c4d06c
  • Upwork Job ID: 1826367055440708714
  • Last Price Increase: 2024-08-28
Issue OwnerCurrent Issue Owner: @Ollyws

Activity

  1. added
    Daily
    Bug
    on Aug 19, 2024
  2. melvin-bot commented on Aug 19, 2024

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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.

  3. IuliiaHerets commented on Aug 19, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #vip-vsb

  4. IuliiaHerets commented on Aug 19, 2024

    @IuliiaHerets
    Author

    @greg-schroeder 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

  5. bernhardoj commented on Aug 20, 2024

    @bernhardoj
    Contributor

    Proposal

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

    We can preview the high res image in its full size.

    What is the root cause of that problem?

    When we first trying to upload the hi-res image, the image preview modal will only show the image icon, file name, and a message that preview is disabled when uploading hi-res image.

    if (isHighResolution) {
    if (!isUploaded) {
    return (
    <>
    <View style={styles.imageModalImageCenterContainer}>
    <DefaultAttachmentView
    icon={Expensicons.Gallery}
    fileName={file?.name}
    shouldShowDownloadIcon={shouldShowDownloadIcon}
    shouldShowLoadingSpinnerIcon={shouldShowLoadingSpinnerIcon}
    containerStyles={containerStyles}
    />
    </View>
    <HighResolutionInfo isUploaded={isUploaded} />
    </>
    );
    }
    imageSource = previewSource?.toString() ?? imageSource;

    After we send the image and open the image preview, this time, isUploaded is true. Before the image is uploaded to the BE, isHighResolution is always false because the file resolution here somehow 0.

    FileUtils.getFileResolution(file).then((resolution) => {
    setIsHighResolution(FileUtils.isHighResolutionImage(resolution));

    But we won't focus on that issue because even if isHighResolution is true, the preview source of the local image is the original source of the image.

    imageSource = previewSource?.toString() ?? imageSource;

    So, the image is shown at its full resolution. Only after the image is uploaded to the BE, the BE returns the preview source that contains a smaller resolution of the file.

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

    We can disable previewing the image before it gets uploaded to the BE. To do that, we need to add data-expensify-preview-modal-disabled="true" to the optimistic img tag,

    App/src/libs/ReportUtils.ts

    Lines 4038 to 4040 in de9cb1f

    if (file.type?.startsWith('image')) {
    return `<img src="${file.uri}" alt="${file.name}" ${dataAttributes} />`;
    }

    which will disable the preview.

    const imagePreviewModalDisabled = htmlAttribs['data-expensify-preview-modal-disabled'] === 'true';

  6. added
    External
    on Aug 21, 2024
  7. changed the title [-]Web - Attachment - Attached long image can be briefly opened in full resolution[/-] [+][$250] Web - Attachment - Attached long image can be briefly opened in full resolution[/+] on Aug 21, 2024
  8. melvin-bot commented on Aug 21, 2024

    @melvin-bot
  9. added
    Help Wanted
    on Aug 21, 2024
  10. melvin-bot commented on Aug 21, 2024

    @melvin-bot

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

  11. 16 remaining items

  12. added
    Weekly
    and removed
    Daily
    on Aug 29, 2024
  13. bernhardoj commented on Aug 29, 2024

    @bernhardoj
    Contributor

    PR is ready
    cc: @Ollyws

  14. roryabraham commented on Sep 2, 2024

    @roryabraham
    Contributor

    Whoa, I think we took the solution much too far for this edge-case issue by disabling all local/offline image previews we spent years building in #44889.

    I know we tagged design in here on this big decision, but I feel pretty strongly that we should revert this and go back to the drawing board on solutions.

    Brought this up with the team in slack here

  15. greg-schroeder commented on Sep 9, 2024

    @greg-schroeder
    Contributor

    Pending discussion above

  16. greg-schroeder commented on Sep 17, 2024

    @greg-schroeder
    Contributor

    @roryabraham can you help summarize where that discussion landed? I admit I'm a bit unfamiliar with this specific space in the product

  17. Ollyws commented on Sep 17, 2024

    @Ollyws
    Contributor

    The PR was reverted in the end, I think we can pay out and close this one.

  18. greg-schroeder commented on Sep 19, 2024

    @greg-schroeder
    Contributor

    Ah, word, yeah I see that now

  19. greg-schroeder commented on Sep 19, 2024

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @bernhardoj - $250 - You can make a manual request via ND
    C+: @Ollyws - $250 - You can make a manual request via ND

    This was reverted, but not because of a bug or anything like that - we just decided not to go this route after saying we wanted to originally.

  20. bernhardoj commented on Sep 19, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  21. JmillsExpensify commented on Sep 19, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  22. Ollyws commented on Sep 19, 2024

    @Ollyws
    Contributor

    Requested in ND.

  23. Ollyws commented on Sep 21, 2024

    @Ollyws
    Contributor

    Seemed that request failed, requested again in ND.

  24. garrettmknight commented on Sep 24, 2024

    @garrettmknight
    Contributor

    $250 approved for @Ollyws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions