Skip to content

[Due for payment 2026-03-13] Optimize camera receipt capture flow to reduce shutter-to-confirmation latency #83469

Closed

Description

@marcaaron

Problem

When a user captures a receipt photo, if they press the shutter button, then the confirmation screen takes ~726-1000ms to appear, creating a laggy, unresponsive feel.

The primary bottleneck is cropImageToAspectRatio() which:

  1. Calls ImageSize.getSize() to read image dimensions
  2. Runs expo-image-manipulator.manipulateAsync() to crop the photo to match the viewfinder aspect ratio
  3. Calls RNFetchBlob.fs.stat() to get the cropped file's size

Secondary UX issues:

  • Upload directory is created at photo capture time rather than earlier
  • Camera continues showing live video after capture, creating a disconnected feeling during navigation

Solution

Reduce latency by eliminating unnecessary async operations and improving perceived responsiveness.

  • Skip cropping entirely by using useCameraFormat() from react-native-vision-camera to match the camera format to the viewfinder aspect ratio upfront
  • Skip ImageSize.getSize() by passing photo dimensions directly from the takePhoto() result
  • Create the upload directory when opening the camera page instead of at capture time (40 ms improvement)
  • Freeze the camera image on capture using the forceInactive prop to prevent the live video continuing after the shot
  • Add a pronounced shutter feedback effect (similar to the multi-capture blink) to make the capture moment feel more responsive
Issue OwnerCurrent Issue Owner: @huult

Activity

  1. self-assigned this
    on Feb 25, 2026
  2. added
    Internal
    NewFeature
    on Feb 25, 2026
  3. melvin-bot commented on Feb 25, 2026

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO. Remember to draft any necessary HelpDot updates by following the instructions here.

  4. melvin-bot commented on Feb 25, 2026

    @melvin-bot

    Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

  5. added
    Daily
    and removed
    Weekly
    on Feb 25, 2026
  6. marcaaron commented on Feb 25, 2026

    @marcaaron
    ContributorAuthor

    @JmillsExpensify @dubielzyk-expensify was thinking we could use the appBG for the "blink" effect, but let me know if you guys have other thoughts on this...

    ScreenRecording_02-25-2026.08-59-39_1.mov

    Note: This video was also taken without the performance improvements mentioned in the issue description and will be a lot smoother once those are added.

  7. marcaaron commented on Feb 25, 2026

    @marcaaron
    ContributorAuthor

    For reference the blink effect we currently have for multi-scan looks like this (which is a bit more subtle than what I posted above):

    ScreenRecording_02-25-2026.10-22-36_1.MP4

    I have a slight preference for the longer blink - but care more about there being a blink for this flow.

  8. JmillsExpensify commented on Feb 25, 2026

    @JmillsExpensify
    Contributor

    I also have a slight preference for the longer blink. And the blink itself looks fine to me.

  9. dubielzyk-expensify commented on Feb 27, 2026

    @dubielzyk-expensify
    Contributor

    I'm fine with either. The previous one was mostly done to be a bit subtle, but if people prefer the others, then go for it

  10. JmillsExpensify commented on Feb 27, 2026

    @JmillsExpensify
    Contributor

    Longer blink then? Let's get this shipped.

  11. 4 remaining items

  12. added
    Weekly
    Awaiting Payment
    and removed
    Daily
    on Mar 5, 2026
  13. changed the title [-]Optimize camera receipt capture flow to reduce shutter-to-confirmation latency[/-] [+][Due for payment 2026-03-13] Optimize camera receipt capture flow to reduce shutter-to-confirmation latency[/+] on Mar 6, 2026
  14. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.31-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 2026-03-13. 🎊

  15. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@marcaaron] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
    • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
  16. melvin-bot commented on Mar 6, 2026

    @melvin-bot

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

  17. JmillsExpensify commented on Mar 9, 2026

    @JmillsExpensify
    Contributor

    No payouts on this one, so closing.

  18. huult commented on Mar 13, 2026

    @huult
    Contributor

    @JmillsExpensify @stephanieelliott I reviewed this PR. Could you help create a payment summary?

  19. JmillsExpensify commented on Mar 13, 2026

    @JmillsExpensify
    Contributor

    Payment summary: $250 @huult via New Expensify

  20. garrettmknight commented on Mar 25, 2026

    @garrettmknight
    Contributor

    $250 approved for @huult

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

Metadata

Metadata

Labels

Awaiting PaymentInternalNewFeatureWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions