You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-08-13] [$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan #65251
Version Number: Reproducible in staging?: Reproducible in production?: New feature, not in prod yet 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 Expensify/Expensify Issue URL: Issue reported by:@dubielzyk-expensify Slack conversation (hyperlinked to channel name):
Action Performed:
Global Create -> Create expense
On the Scan tab, enable the Multi-Scan
Take a few pictures in a row
Tap on a receipt from the bottom carousel with the receipt previews
Expected Result:
No horizontal padding should be there
Actual Result:
There is a horizontal padding
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
changed the title [-]iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/-][+][$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/+]on Jul 1, 2025
Please re-state the problem that we are trying to solve in this issue.
When using Multi-Scan to create expenses on iOS, opening a receipt from the bottom carousel shows incorrect horizontal padding. The first carousel item displays correctly, but after swiping to other items and returning, the images appear smaller with unwanted horizontal padding. This only affects the carousel version of the lightbox - the confirmation screen displays correctly.
What is the root cause of that problem?
The issue is in the Lightbox component's contentSize caching mechanism. When images become invisible during carousel navigation, their cached dimensions get corrupted with undefined values. Here's the problematic sequence:
Initial load: Image loads with correct dimensions (525x700)
Swipe: Image becomes invisible, cache gets poisoned with undefined
Return: Image loads again but gets wrong dimensions from cache corruption
Result: Wrong contentSize causes incorrect scaling and horizontal padding
The cache is being shared across different images, and when one image's lightbox becomes invisible, it overwrites the cache with undefined values that then affect other images.
What changes do you think we should make in order to solve the problem?
Fix the contentSize caching logic in src/components/Lightbox/index.tsx to prevent cache corruption:
// Clear cache when component unmountsuseEffect(()=>{return()=>{cachedImageDimensions.delete(uri);};},[uri]);// When lightbox becomes invisible, only reset local state, not cacheuseEffect(()=>{if(isLightboxVisible){return;}setLightboxImageLoaded(false);setInternalContentSize(cachedImageDimensions.get(uri));},[isLightboxVisible,uri]);// Don't cache undefined valuesconstsetContentSize=useCallback((newDimensions: ContentSize|undefined)=>{setInternalContentSize(newDimensions);if(newDimensions!==undefined){cachedImageDimensions.set(uri,newDimensions);}},[uri],);// Always update with actual loaded dimensionsconstupdateContentSize=useCallback(({nativeEvent: {width, height}}: ImageOnLoadEvent)=>{constnewDimensions={width, height};setContentSize(newDimensions);},[setContentSize,uri],);
Result
Kapture.2025-07-06.at.17.28.57.mp4
The key changes are: stop caching undefined values, preserve cached dimensions when lightbox becomes invisible, and always update with actual loaded dimensions instead of conditionally skipping updates.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Test carousel navigation with multiple images to ensure contentSize consistency is maintained after swiping between items.
What alternative solutions did you explore? (Optional)
changed the title [-][$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/-][+][Due for payment 2025-08-13] [$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/+]on Aug 6, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.89-21 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dukenv0307@dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
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
2b. Reported on staging (deploy blocker)
2c. 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: Edge case
[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: N/A
[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. Yes
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Mobile/mWeb:
Global Create -> Create expense
On the Scan tab, enable the Multi-Scan
Take a few pictures in a row
Tap on a receipt from the bottom carousel with the receipt previews
Make sure the receipt has no extra horizontal padding
Activity
melvin-bot commentedon Jul 1, 2025
Triggered auto assignment to @slafortune (
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.[-]iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/-][+][$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/+]melvin-bot commentedon Jul 1, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021940028187974415088
melvin-bot commentedon Jul 1, 2025
Current assignee @dukenv0307 is eligible for the External assigner, not assigning anyone new.
MobileMage commentedon Jul 1, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When using Multi-Scan to create expenses on iOS, opening a receipt from the bottom carousel shows incorrect horizontal padding. The first carousel item displays correctly, but after swiping to other items and returning, the images appear smaller with unwanted horizontal padding. This only affects the carousel version of the lightbox - the confirmation screen displays correctly.
What is the root cause of that problem?
The issue is in the Lightbox component's contentSize caching mechanism. When images become invisible during carousel navigation, their cached dimensions get corrupted with undefined values. Here's the problematic sequence:
The cache is being shared across different images, and when one image's lightbox becomes invisible, it overwrites the cache with undefined values that then affect other images.
What changes do you think we should make in order to solve the problem?
Fix the contentSize caching logic in
src/components/Lightbox/index.tsxto prevent cache corruption:Result
Kapture.2025-07-06.at.17.28.57.mp4
The key changes are: stop caching undefined values, preserve cached dimensions when lightbox becomes invisible, and always update with actual loaded dimensions instead of conditionally skipping updates.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Test carousel navigation with multiple images to ensure contentSize consistency is maintained after swiping between items.
What alternative solutions did you explore? (Optional)
N/A
MobileMage commentedon Jul 1, 2025
Proposal
Updated here
52 remaining items
[-][$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/-][+][Due for payment 2025-08-13] [$250] iOS - Wrong horizontal padding when opening a receipt while creating expenses with Multi-Scan[/+]melvin-bot commentedon Aug 6, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 6, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.89-21 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 2025-08-13. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Aug 6, 2025
@dukenv0307 @dylanexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
dukenv0307 commentedon Aug 7, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: Edge case
[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: N/A
[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. Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
dylanexpensify commentedon Aug 13, 2025
Payment summary:
Contributor+: @dukenv0307 $250 via NewDot
Please apply/request!
melvin-bot commentedon Aug 13, 2025
Payment Summary
Upwork Job
BugZero Checklist (@dylanexpensify)
garrettmknight commentedon Aug 20, 2025
$250 approved for @dukenv0307