Playbook Website: Fixes for Dialog popup for VPN - #6613
Closed
nidaqg wants to merge 3 commits into
Closed
Conversation
…uting" (…" This reverts commit 38b160d.
Contributor
Author
|
not doing this for now, going a different route |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the "VPN required" Playground dialog, which was unreliable in two ways after [PLAY-3203] shipped:
fetch(..., { mode: "no-cors" }), which resolves on any HTTP response — including a block/error page served for off-VPN traffic — so it couldn't tell a real block from success. That was also browser-dependent (Firefox's DNS handling could reach a different response than Chrome's), so the dialog showed correctly in Chrome but not Firefox, which just hit a raw 404 instead.<img>load probe (onload/onerror instead of fetch) fixed the first bug, but the probe target,/favicon.ico, was never added to staging's route allow-list inroutes.rb. Any unlisted path on staging falls through to its own catch-all, which redirects back to prod — so the probe was silently checking prod's favicon the whole time, always "succeeding" as a redirect, which made the dialog show up even while on VPN with no way to get to staging.Fix:
isStagingReachable()(siteNavigation.ts) now probes via an<img>element instead of a no-corsfetch— a non-image response (e.g. an HTML block page) correctly fails to decode and firesonerror, independent of browser-specific network/DNS behavior.GET /vpn_check.gifto staging's host-constrained routes, ahead of the catch-all, serving a tiny inline 1×1 GIF. Being explicitly allow-listed, it can never be swept into the redirect-to-prod fallback, so the probe now genuinely reflects staging's own reachability.How to test?
curl -sI https://staging.playbook.powerapp.cloud/vpn_check.gifwhile on VPN — expect200,Content-Type: image/gif, no redirect.Checklist:
bugpatch