-
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
Update attachment link URL replacing logic #14463
Update attachment link URL replacing logic #14463
Conversation
@mountiny @mananjadhav One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me in general! Great job! @mananjadhav will you be able to give this one a test?
src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js
Outdated
Show resolved
Hide resolved
Hey hey!!! Not sure what went wrong here, I missed all the conversation on the issue 😥 @mountiny I'll review the conversation and also review the PR. Sorry for missing the proposal review. |
@mananjadhav no problem at all, Kidroca brought this issue up and we went with his proposal so everything is fine. |
e3e7e38
to
04c2e21
Compare
04c2e21
to
72a2950
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kidroca, waiting for the testing now
@mananjadhav Will you be bale to do the reviewer checklist as well? |
Reviewer Checklist
Screenshots/VideosWebweb-attachment-urls.movMobile Web - Chromemweb-chrome-attachment-urls.movMobile Web - Safarimweb-safari-attachment-urls.movDesktopdesktop-attachment-urls.moviOSios-attachment-urls.movAndroidandroid-attachment-urls.mov@mountiny Completed the review list, attachment testing took some time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @kidroca @mananjadhav
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.2.63-0 🚀
|
We are facing issue with this one. Not sure if something we are doing is not right, but images are opened from the wrong Environment Screen.Recording.2023-02-02.at.00.16.55.1.mov |
Yes I'm running into the same issue - failure to open a PDF uploaded from staging in prod Though other file types seem to work fine |
@mvtglobally @thienlnam Can we confirm this was not malfunctioning before already? I know there were some issues with these. |
Not sure how we'd do that because now staging has the change and we can't check the previous version of staging. Though I'm going to just create another issue for it #14739 and move forward with deploy |
this PR supposed to fix it, no? |
@mvtglobally do you get anything in the console? Or any error with that PDF which is not able to load. Yeah this PR should be loading the attachments from appropriate endpoints. |
🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.63-0 🚀
|
I had this issue from before the PR, I've posted about it here: #14227 (comment) I think at the moment only I should have described it in the testing steps, but since the fix is not yet on |
@kidroca Its deployed not #14463 (comment) @mvtglobally Would you be able to re-test with the latest App version, please? Thanks! |
Details
Update existing logic that changes URLs to resolve from API ROOT to handle more URL patterns.
URLs coming from these origins should be updated to resolve from API_ROOT
/
that have no origin part)Fixed Issues
$ #14227
PROPOSAL: #14227 (comment)
Tests
At the moment the backend is not yet saving attachments using the absolute path, so we need to simulate the result
We need to inspect and modify Onyx data
Find an attachment action and modify the
html
of the message so that the<img src="https://{env}.expensify.com/chat-attachments/{path}" />
part becomes<img src="/chat-attachments/{path}" />
Example
In Chrome dev console:Now refresh the browser. The (modified) attachment should resolve and load successfully from API ROOT
Offline tests
Expected Offline behavior
Expected slow internet behavior
QA Steps
https://www.expensify.com/...
urlstaging.expensify.com
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android