Skip to content

[Due for payment 2025-10-03] [$250] mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely #68778

Closed

Description

@jponikarchuk

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: 9.1.96-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exploratory
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: iPhone 15 iOS 18.5 Safari
App Component: Money Requests

Action Performed:

  1. Navigate to staging.new.expensify.com in incognito tab and sign in with a new gmail account
  2. Create a workspace
  3. Navigate to the workspace chat, tap +, "Create expense"
  4. Tap "Choose file", select a receipt in the HEIC format
  5. Select category and create an expense
  6. Observe the page - it reloads or infinite loading is shown, the receipt is not uploaded

Expected Result:

Scan expense is created successfully

Actual Result:

After uploading a HEIC receipt, the page reloads and user is dropped on the create expense screen, or an infinite loading is shown

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

logs.txt

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021957911143598202765
  • Upwork Job ID: 1957911143598202765
  • Last Price Increase: 2025-08-19
  • Automatic offers:
    • QichenZhu | Contributor | 108541076
    • dominictb | Contributor | 108812869
Issue OwnerCurrent Issue Owner: @OfstadC

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 19, 2025
  2. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    Triggered auto assignment to @OfstadC (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. lorretheboy commented on Aug 19, 2025

    @lorretheboy
    Contributor

    Proposal

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

    mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely

    What is the root cause of that problem?

    We can upload HEIC files as it will be convert to jpeg format, however the problem here is about the broken HEIC file which cannot be converted - when HEIC conversion fails, the convertHeicImageToJpegPromise function rejects the promise, but there's no .catch() handler for the Promise.all() that processes the HEIC files. This means when HEIC conversion fails, the promise chain breaks and the user gets stuck in an infinite loading state.

    const convertHeicImageToJpegPromise = (file: FileObject): Promise<FileObject> => {
    return new Promise((resolve, reject) => {
    convertHeicImage(file, {
    onSuccess: (convertedFile) => resolve(convertedFile),
    onError: (nonConvertedFile) => {
    reject(nonConvertedFile);
    },
    });
    });
    };

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

    Update to fallback to original file if we cannot convert

        const convertHeicImageToJpegPromise = (file: FileObject): Promise<FileObject> => {
            return new Promise((resolve) => {
                convertHeicImage(file, {
                    onSuccess: (convertedFile) => resolve(convertedFile),
                    onError: (error, nonConvertedFile) => {
                        collectedErrors.current.push({error: CONST.FILE_VALIDATION_ERRORS.FILE_CORRUPTED});
                        // Resolve with original file to continue processing
                        resolve(nonConvertedFile);
                    },
                });
            });
        };

    Add catch statement here as well

                            .catch(() => {
                                setIsLoaderVisible(false);
                                // Return original files if conversion fails completely
                                return Promise.resolve({processedFiles: otherFiles, pdfsToLoad});
                            });

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    We can update to show err CONST.FILE_VALIDATION_ERRORS.FILE_CORRUPTED if we cannot convert

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. lorretheboy commented on Aug 19, 2025

    @lorretheboy
    Contributor

    Could you please attach the image used in video here? Thank you

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 19, 2025
  6. changed the title [-]mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely[/-] [+][$250] mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely[/+] on Aug 19, 2025
  7. melvin-bot commented on Aug 19, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 19, 2025
  9. melvin-bot commented on Aug 19, 2025

    @melvin-bot

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

  10. hoangzinh commented on Aug 20, 2025

    @hoangzinh
    Contributor

    @jponikarchuk, can you request to share the HEIC file that QA team used to reproduce this issue? Thanks

  11. jponikarchuk commented on Aug 21, 2025

    @jponikarchuk
    Author

    @hoangzinh Sorry, HEIC file type is not supported to share here.

  12. lorretheboy commented on Aug 21, 2025

    @lorretheboy
    Contributor

    @hoangzinh Sorry, HEIC file type is not supported to share here.

    could you please help upload to an external platform then drop the link here? @jponikarchuk

  13. 90 remaining items

  14. changed the title [-][Due for payment 2025-10-03] [Due for payment 2025-10-01] [$250] mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely[/-] [+][Due for payment 2025-10-03] [$250] mWeb - Scan - Can't upload a receipt in HEIC format, page reloads or loads infinitely[/+] on Oct 3, 2025
  15. mountiny commented on Oct 3, 2025

    @mountiny
    Contributor

    I think the total payment would be $500 here for @QichenZhu as they have helped with couple PRs and helped a lot to debug too.

    Confirmed with QA that this is no longer reproducible.

  16. OfstadC commented on Oct 3, 2025

    @OfstadC
    Contributor

    Just to confirm @mountiny

    $500 for @QichenZhu and $250 for @dominictb ?

  17. OfstadC commented on Oct 6, 2025

    @OfstadC
    Contributor

    Friendly bump @mountiny - I just want to make sure i'm issuing the proper payment 😅 Thank you!

  18. OfstadC commented on Oct 7, 2025

    @OfstadC
    Contributor

    Just waiting on confirmation of the proper payment here 😅

  19. mountiny commented on Oct 8, 2025

    @mountiny
    Contributor

    Sorry for the delay, I think that is right as @dominictb only had this one PR #70866

  20. OfstadC commented on Oct 9, 2025

    @OfstadC
    Contributor

    Thanks @mountiny ! ❤️

  21. OfstadC commented on Oct 9, 2025

    @OfstadC
    Contributor

    Payment Summary

  22. moved this from AWAITING DEPLOYMENT to Done in [#whatsnext] #qualityon Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions