Skip to content

AppRoutingEffects' async initialization leads to race conditions, clearing URL params #4207

@psybuzz

Description

@psybuzz

In #4197, we discovered a race condition and fixed it
in a non-ideal manner.

Background:

when both AppRoutingEffects and CoreEffects initialize, they make some changes asynchronously; former makes modification to URL (with two debounce/nextTick) and latter makes XHR to fetch plugins listing. Nothing guarantees that the XHR to land after the URL is modified and the test did reveal the cases when the XHR finished before router getting initialized.

from #4197 (comment)

The symptom is that after opening TensorBoard, the '#scalars' hash may get dropped
from the URL immediately. Any actions that update the hash with a key=value, e.g.
changing smoothing (adds &smoothingWeight=... to URL) causes TensorBoard to
show "No active plugin".

The PR proposes a fix where AppRouting preserves any URL hash during its initial
'navigated' action. However, it would be more ideal if AppRouting itself could
manage the URL hash entirely.

Alternatively, HashStorageContainer could be modified to wait for AppRouting
to initialize, before HashStorageContainer sets '#scalars' in the URL hash.
However, for this to land, it requires all TB embedders to use AppRouting.

Googlers, see mirrored issue b/169799696

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions