-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔴 [$500] App crashes when opening the second distance request as a reviewer #26925
Comments
Triggered auto assignment to @bfitzexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~014b20f43c302788fe |
Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.App crashes when opening the second distance request as a reviewer. What is the root cause of that problem?The crash is coming from the Lines 40 to 52 in 46e6e20
It can also happen when opening the first distance request on a newly created workspace. This can be reliably reproduced when the reviewing user attempts to open the request before the receipt preview image has actually loaded. It may occur if Onyx data from Pusher has not finished updating the reviewer's local database. The issue can stem from this line:
What changes do you think we should make in order to solve the problem?
function getThumbnailAndImageURIs(path, filename) {
+ if (!filename) {
+ return {thumbnail: null, image: ReceiptGeneric};
+ }
// ... rest of the method
} What alternative solutions did you explore? (Optional)None. |
Problem Statement: Root Cause: Proposed Solution: Here's the code for the proposed solution: def isValidFilename(filename):
INVALID_CHARS = set(r'\/:*?"<>|')
MAX_FILENAME_LENGTH = 255 # Typically, most file systems limit filenames to 255 characters
# Check if filename is None (null/undefined in JS context)
if filename is None:
return False
# Check for empty filename or filename with just whitespace
if filename.strip() == "":
return False
# Check for excessively long filenames
if len(filename) > MAX_FILENAME_LENGTH:
return False
# Check for invalid characters
if any(char in INVALID_CHARS for char in filename):
return False
# Check if filename starts or ends with a dot
if filename.startswith('.') or filename.endswith('.'):
return False
return True
def getThumbnailAndImageURIs(path, filename):
# If not a valid filename, return default values
if not isValidFilename(filename):
return {'thumbnail': None, 'image': 'ReceiptGeneric'}
# ... [rest of the original function logic] Alternative Solution: |
@akinwale How will the money request action component look like until the receipt is loaded? |
It displays the default generic receipt image (the green placeholder) until the image loads. I can make a video to demo this. |
ProposalPlease re-state the problem that we are trying to solve in this issue.App crashes when opening the second distance request as a reviewer. What is the root cause of that problem?Lines 40 to 52 in 46e6e20
when file name is empty its crashing and pusher send an different property 'receiptFilename' we already updated in this PR
What changes do you think we should make in order to solve the problem?we should update ReceiptUtils.getThumbnailAndImageURIs(transaction.receipt.source, transaction.filename || transaction.receiptFilename || ''); and here we should declare the default param (in future avoid like this crash we should take default value in the param) getThumbnailAndImageURIs(path, filename = '') @mountiny @hayata-suenaga |
@mountiny Demo video. My connection is a bit slow so it takes a while to load. 26925-demo.mp4 |
@ArekChr could you review the proposals? |
I'm taking over as requested internally in Slack here |
Are there steps on how to trigger this crash? I couldn't reproduce it |
@ArekChr this will help you reproduce this video but now the issue was changed pusher not sending the Untitled.mov |
@neil-marcellini @ArekChr could you check this on the Backend side. |
@pradeepmdk I couldn't load the video. Could you optimize it and send it in a smaller size? |
@ArekChr which one this one on slack bug reproduce video this video I converted this video here bug_repro.video-converter.com.mp4 |
@ArekChr You can also check out the demo video I posted here: #26925 (comment) At the time, I was able to reliably reproduce if I tried to open the request before the image loaded. |
@akinwale, @pradeepmdk Thanks for videos! I tested that scenario again and It seems the app is not crashing anymore on the main branch and staging, there is a different issue with no loaded distance request which is not related to this issue. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@ayazhussain79 this is not yet fixed. previously pusher sent the wrong data so it crashed. now Pusher not sending that whole object so the issue has changed now. |
@pradeepmdk, The bug with the crash issue, is not reproducible anymore |
@ArekChr Yes I agree, I am just explaining @ayazhussain79 to the issue that has changed now. The crash issue is no more here. Maybe one pusher is fixed and again |
I think we can close this issue, for the infinite skeleton loading bug, there is a separate issue created here |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
User A should be able to view the new distance request
Actual Result:
App crashes
Workaround:
N/A
Platforms:
Only tested on web. Not sure if the issue is present on other platforms, too
Version Number: v1.3.64-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: N/A
**Email or phone of affected tester (no customers): N/A
Logs: N/A
Notes/Photos/Videos:
Please refer to this video (I couldn't upload the video)
**Expensify/Expensify Issue URL: N/A
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694035685129389
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: