-
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
[HOLD for payment 2023-04-04] Attachments (w/o preview: mp4, docx etc) use Prod domain in case of download #16327
Comments
Triggered auto assignment to @maddylewis ( |
Bug0 Triage Checklist (Main S/O)
|
@kidroca Can you have a look at this one? This came from testing your PR, thanks! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Downloading attachments with no preview is not respecting the API in use - being on staging would load an attachment from the prod URL (when the attachment was originally uploaded on prod) What is the root cause of that problem?When we upload an attachment the backend saves the address including the host where the attachment was originally uploaded from (uploading an attachment from prod, saves the prod address to the attachment) What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)Because of Old Dot, a migration would probably not be possible ATM (migration would break Old Dot) We have reusable logic that remmaps hosts to the current environmentApp/src/libs/tryResolveUrlFromApiRoot.js Lines 17 to 30 in 44f9871
We can use it in order to substitute the API portion of the address with the API we're currently using, by updating the code here
With something like const attrHref = ApiUtils.tryResolveUrlFromApiRoot(htmlAttribs.href); The ideal solution would be if we don't have to do anything with the URL at all
The next best thing is, manually prefixing with the current api And 3rd, the only thing possible ATM is, replacing the origin dynamically |
Lets fix this @kidroca feel free to create a PR |
BTW the issue is not tied to Desktop - it affects all platforms, though I don't think QA would be able to detect this on mobile |
Makes sense, updated the title and issue body |
@kidroca Feel free to make a PR for this! |
Attachments should be downloaded from a path relative to the current API root See: Expensify#16327 (comment)
Created a PR, ready for review, I'll be able to add test steps and screens on Monday |
PR updated and ready for review |
✅ PR was merged last week |
@maddylewis Please move this back to Weekly and assign me as C+ as I reviewed the PR. Also, the header did not update to reflect payments, etc. Thanks. |
@maddylewis could you please pay @parasharrajat $1000 for his work on this issue, thank you very much! |
on it! |
paid! |
Question: Is this Internal or external @mountiny? Or this was handled as regression. If this is external, is it valid for a bonus? |
I would say this was handled as a regression/ oversight since we implemented these changes before and this hsould have been done in the original PR Are we good to close? |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR #15178
Action Performed:
Expected Result:
All attachment URLs to be resolved relative to current environment
Actual Result:
If file without preview like docx or mp4 sent from the Prod and it will be downloaded from the Staging via www.expensify.com
domain instead of staging.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.87.0
Reproducible in staging?: Yes
Reproducible in production?: yes
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
Notes/Photos/Videos: Any additional supporting documentation
Bug5985447_Screen_Recording_2023-03-20_at_19.21.21.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: