You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dataset page keeps stale likes and views when its route changes #9697
The dataset detail page (DatasetDetailComponent) reloads its info, versions and files whenever its route's did changes, but it loads the like count, view count and liked state only once. ngOnInit subscribes to the route params and then makes the hub calls (getCounts, postView, isLiked) a single time, with whatever did held at that moment. If the router keeps the page and only changes the did, the page shows the new dataset with the old dataset's likes, views and liked state, and posts no view for the new dataset.
The page also stores the route segment, a string, in did: number | undefined, and sends any segment, such as abc, to the backend.
The model detail page already does both right: it parses mid once, shows "This is not a valid model id" for anything that is not a positive integer, and loads its hub state inside the params handler for every id.
Expected: the dataset page behaves the same way.
No page links one dataset straight to another today, so the like and view part shows only when the route changes in place. kunwp1 found this while reviewing #9692.
How to reproduce?
Open /dashboard/user/dataset/<A>.
Without leaving the page, route it to /dashboard/user/dataset/<B>, for example with router.navigate(["/dashboard/user/dataset", B]). The router reuses the component and only its params emit again.
The name, versions and files switch to B. The like count, view count and liked state stay A's, and no view is recorded for B.
For the id: /dashboard/user/dataset/abc sends abc to the dataset endpoints instead of rejecting it.
Activity
fix(frontend): load dataset and model state per route id (apache#9698)