-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix: LSDV-5096: Loading a pre-signed url with the new proxy urls in a new tab does not work #4194
Conversation
… new tab does not work
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for heartex-docs canceled.
|
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #4194 +/- ##
===========================================
+ Coverage 75.64% 76.06% +0.41%
===========================================
Files 156 156
Lines 12164 11893 -271
===========================================
- Hits 9202 9046 -156
+ Misses 2962 2847 -115 ☔ View full report in Codecov by Sentry. |
/git merge develop
|
… new tab does not work (HumanSignal#4194) * fix: LSDV-5096: Loading a pre-signed url with the new proxy urls in a new tab does not work * check if referrer was empty to detect loading resource in new tab * the referrer is on the request of the event not directly on the event --------- Co-authored-by: bmartel <bmartel@users.noreply.github.com>
PR fulfills these requirements
[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made
ex.fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
Change has impacts in these area(s)
(check all that apply)
Describe the reason for change
When loading a url in a new tab, ie. Right-click and opening an image in a new tab, when using cloud storage and presigned urls does not work correctly.
What does this fix?
When accessing a proxy pre-signed url directly, by either entering this url into an address bar or opening an image into a new tab, this will work without the service worker and fixes weird behaviours where the redirect doesn't work within this scope, as the page itself is not actually a view or anything we are directly serving so the service worker can sometimes fail to serve anything which seems to be the case more often than not. Locally I could get this to eventually resolve but deployments of label-studio were consistently failing.
What is the new behavior?
Don't cache redirects for proxy pre-sign urls that are navigated directly to (ie. another tab with the url placed into it, or a new tab opened directly from an image resource).
What is the current behavior?
Cache all on domain requests to presign.
What libraries were added/updated?
None.
Does this change affect performance?
No, this just ensures there is appropriate handling for this case and this does mean it will actively resolve the url but overall that will not create a large issue as it is a one-off case to do this.
Does this change affect security?
No.
What alternative approaches were there?
N/A
What feature flags were used to cover this change?
fflag_fix_all_lsdv_4711_cors_errors_accessing_task_data_short
Does this PR introduce a breaking change?
(check only one)
What level of testing was included in the change?
(check all that apply)
Which logical domain(s) does this change affect?
Presigned URLs, Cloud Storage