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
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
uri doest not support local image
this pr is enabled this feature https://github.com/Expensify/App/pull/24235/files
when first time editMoneyRequest called we are getting with receipt so that on second time we are setting as open in optimastic data so at the time has receipt is there and open the <ReportActionItemImage /> and we are trying to show the image ..so at the time we are passing wrong source param and app is broken
@pradeepmdk I don't think I'm following your proposal. The <ReportActionItemImage /> component is only used if the transaction has a receipt, and the bug video shows that it is a cash request.
If it does have something to do with that PR, the PR has already deployed to production, so this wouldn't be a deploy blocker. @lanitochka17 could you try to reproduce the issue on production again and confirm for me if it crashes or not?
@amyevans I agree is shown only when have 'receipt', but when editMoneyRequestcalled first time its return the receipt data so that its start occurring from second time
but when hasReceipt we are calling this and get the image on the image we are returning the local assets images
ReceiptUtils.getThumbnailAndImageURIs(transaction.receipt.source, transaction.filename);
inside the function
let image = ReceiptGeneric;
if (fileExtension === CONST.IOU.FILE_TYPES.HTML) {
image = ReceiptHTML;
}
if (fileExtension === CONST.IOU.FILE_TYPES.DOC || fileExtension === CONST.IOU.FILE_TYPES.DOCX) {
image = ReceiptDoc;
}
if (fileExtension === CONST.IOU.FILE_TYPES.SVG) {
image = ReceiptSVG;
}
return {thumbnail: null, image};
local assets image when we import its has a reference number not a actual path
on that refrence should be passed source={image} but we are passing into source={{uri: image}} so that app is crashed.
for BE:
For this first point has 'receipt' editMoneyRequest should not return the when receipt.state is empty.
for FE:
we should check here receipt.state should not be an empty when for open if (shouldStopSmartscan && _.has(transaction, 'receipt') && !_.isEmpty(transaction.receipt) && lodashGet(transaction, 'receipt.state') !== CONST.IOU.RECEIPT_STATE.OPEN) {
and for this crash part source={assets ? assets : {uri: image}}. uri will apply for blob or file . so that its should not crash is when receipt data as well.
Cool, @roryabraham mind confirming the issue is no longer reproducible? My Android build is hosed at the moment, trying to get that going again but in the meantime I can't test 😅
Activity
OSBotify commentedon Aug 24, 2023
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Aug 24, 2023
Triggered auto assignment to @amyevans (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.pradeepmdk commentedon Aug 24, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Android - Request money - App crashes when editing Amount twice
What is the root cause of that problem?
App/src/components/ReportActionItem/ReportActionItemImage.js
Line 75 in 329cac3
uri doest not support local image
this pr is enabled this feature
https://github.com/Expensify/App/pull/24235/files
when first time
editMoneyRequestcalled we are getting with receipt so that on second time we are setting as open in optimastic data so at the time has receipt is there and open the<ReportActionItemImage />and we are trying to show the image ..so at the time we are passing wrong source param and app is brokenApp/src/libs/TransactionUtils.js
Lines 123 to 125 in 329cac3
What changes do you think we should make in order to solve the problem?
here in ReportActionItemImage uri will doesn't support local assets file path.
so we need 'ReportActionItemImage' one more props if we are trying to load assets image means
and this function should return
getThumbnailAndImageURIs{thumbnail: null, image: null , assets: localImagepath};and
here we should OPEN only
receipt.statenot empty and not open oneditMoneyRequestapiNathan-Mulugeta commentedon Aug 24, 2023
Hey guys I think this bug report might have the same root cause as the one I have reported. And my report came first here on slack.
amyevans commentedon Aug 24, 2023
@pradeepmdk I don't think I'm following your proposal. The
<ReportActionItemImage />component is only used if the transaction has a receipt, and the bug video shows that it is a cash request.If it does have something to do with that PR, the PR has already deployed to production, so this wouldn't be a deploy blocker. @lanitochka17 could you try to reproduce the issue on production again and confirm for me if it crashes or not?
pradeepmdk commentedon Aug 24, 2023
@amyevans I agree is shown only when have 'receipt', but when
editMoneyRequestcalled first time its return the receipt data so that its start occurring from second timeat the time ReportActionItemImage is showing.
App/src/libs/actions/IOU.js
Line 974 in 329cac3
but when
hasReceiptwe are calling this and get the image on the image we are returning the local assets imageslocal assets image when we import its has a reference number not a actual path
on that refrence should be passed source={image} but we are passing into source={{uri: image}} so that app is crashed.
pradeepmdk commentedon Aug 24, 2023
for BE:
For this first point has 'receipt' editMoneyRequest should not return the when
receipt.stateis empty.for FE:
we should check here
receipt.stateshould not be an empty when for openif (shouldStopSmartscan && _.has(transaction, 'receipt') && !_.isEmpty(transaction.receipt) && lodashGet(transaction, 'receipt.state') !== CONST.IOU.RECEIPT_STATE.OPEN) {and for this crash part
source={assets ? assets : {uri: image}}.uriwill apply for blob or file . so that its should not crash is when receipt data as well.mountiny commentedon Aug 24, 2023
@amyevans fyi this will be fixed with the next auth deploy happening real soon I think https://github.com/Expensify/Auth/pull/8562
So maybe we can just wait
pradeepmdk commentedon Aug 24, 2023
@mountiny still we have an issue with loading images from local assets
getThumbnailAndImageURIsLocal assets should be passed to without uri
And this function should return if we have http url
roryabraham commentedon Aug 24, 2023
https://github.com/Expensify/Auth/pull/8562 has been deployed
Pujan92 commentedon Aug 24, 2023
I think not reproducible now as the receipt state is not updated unnecessarily when the request type is not scan.
amyevans commentedon Aug 24, 2023
Cool, @roryabraham mind confirming the issue is no longer reproducible? My Android build is hosed at the moment, trying to get that going again but in the meantime I can't test 😅
roryabraham commentedon Aug 24, 2023
Confirmed, no longer reproducible.
melvin-bot commentedon Sep 3, 2023
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.