Skip to content

[Ready for payment] [$250] Scan-After selecting a corrupt file, the camera is deactivated #64295

Closed

Description

@mitarachim

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.67-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: https://expensify.testrail.io/index.php?/tests/view/6286833
Email or phone of affected tester (no customers): agexptest+pr1606.2@gmail.com, applausetester+ag1606.2@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Samsung S23FE/ Android 15
App Component: Money Requests

Action Performed:

Precondition: Have a scan expense in a workspace.
The Expensify Hybrid app has camera permission enabled.

  1. Open the Expensify Hybrid app
  2. Log in with any account as admin or employee
  3. Go to any scan expense details
  4. Tap the receipt preview
  5. Tap on the three-dot menu > Replace > Image icon > Choose file
  6. Select a corrupted PDF file
  7. Note that the attachment error is shown, and the background turns black
  8. Tap Ok
  9. Tap the green circle button
  10. Tap the back arrow at the top left
  11. Note that a camera error message is shown before go back to the expense details

Expected Result:

After step 7, the camera remains activated in the background. The user can repeat the file selection.
If there is an issue with the camera, an error message will appear immediately after tapping the green circle button.

Actual Result:

After trying to upload a corrupt file, the camera is deactivated. After tapping the back arrow, the camera error message is displayed.

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

Bug6862105_1750118475193.camera_deactivated.mp4

Corrupted PDF.pdf

Image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021935841655617073597
  • Upwork Job ID: 1935841655617073597
  • Last Price Increase: 2025-06-19
  • Automatic offers:
    • dominictb | Reviewer | 107779728
    • nyomanjyotisa | Contributor | 107779729
Issue OwnerCurrent Issue Owner: @RachCHopkins

Activity

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

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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. RachCHopkins commented on Jun 17, 2025

    @RachCHopkins
    Contributor

    @mitarachim do you have a corrupt PDF file I can triage with?

  4. mitarachim commented on Jun 17, 2025

    @mitarachim
    Author

    Hello @RachCHopkins , sorry i forgot to attach.
    we can use below corrupted files (pdf and jpg)

    Corrupted PDF.pdf

    Image

  5. nyomanjyotisa commented on Jun 17, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Scan-After selecting a corrupt file, the camera is deactivated

    What is the root cause of that problem?

    When a corrupted PDF file is selected through the AttachmentPicker, the onClosed callback is executed which only sets setIsLoaderVisible(false), but we did not reset the didCapturePhoto state variable that controls camera activation

    onClosed: () => {
    setIsLoaderVisible(false);
    },

    When file selection fails due to corruption, the didCapturePhoto state is never reset causing the state remains true, which prevents further camera operations

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

    We could reset the didCapturePhoto state by setting it to false to ensure the camera remains available for further operations

                                            onClosed: () => {
                                                setIsLoaderVisible(false);
                                                setDidCapturePhoto(false);
                                            },

    onClosed: () => {
    setIsLoaderVisible(false);
    },

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

    None

    What alternative solutions did you explore? (Optional)

    None

  6. RachCHopkins commented on Jun 19, 2025

    @RachCHopkins
    Contributor

    Can repro!

  7. removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 19, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 19, 2025
  9. 20 remaining items

  10. dominictb commented on Jul 8, 2025

    @dominictb
    Contributor

    @RachCHopkins PR #64781 (comment) hit production 7 days ago. Ready for payment.

  11. dominictb commented on Jul 8, 2025

    @dominictb
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: NA, this is an edge case that happens on specific devices and operating systems which depends on manufacturer configurations

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

      Note: No regression test is needed because this is a extreme edge case that happens on specific devices and operating systems. There is no consistent reliable reproduce steps.

  12. melvin-bot commented on Jul 17, 2025

    @melvin-bot

    This issue has not been updated in over 15 days. @justinpersaud, @RachCHopkins, @nyomanjyotisa, @dominictb eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  13. changed the title [-][$250] Scan-After selecting a corrupt file, the camera is deactivated[/-] [+][Ready for payment] [$250] Scan-After selecting a corrupt file, the camera is deactivated[/+] on Jul 18, 2025
  14. RachCHopkins commented on Jul 18, 2025

    @RachCHopkins
    Contributor

    Payment Summary:

    Upwork job here

  15. RachCHopkins commented on Jul 18, 2025

    @RachCHopkins
    Contributor

    Contributors have both been paid, the contracts have been completed, and the Upwork post has been closed.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions