bug: fix AppRouting interference with URL queryParam-reading components #4213
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.
See #4207 for details.
Several callsites in TB's Angular and Polymer codebases read
directly from
window.location.search. For example, scalar cardsread the
?tensorboardColab=trueparam at arbitrary times inthe TB session, to know whether TB is running inside Colab.
AppRoutingEffects has an initialization step that clears/discards
all existing URL queryParams, causing breaking behavior.
Since AppRouting is not yet a complete source of truth for URL
query params, this change makes all callsites that read from
window.location.searchdo so on the initial app load, beforeAppRouting can interfere.
An alternative considered was making AppRoutingEffects aware
of a hardcoded list of reserved queryParam keys, and preserving
them whenever updating the URL. In that approach, there are
some unknown questions, e.g. if a user navigates to a different
route and returns to the original route, do we still need to preserve
queryParams?
Manually tested that running TB with
?tensorboardColab=trueand opening scalar cards results in network requests to
the
/scalarsendpoint, not/scalars_multirun.