From f335217b718983ccfc90297664925259c308462e Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Wed, 25 Nov 2026 14:59:47 +0000 Subject: [PATCH] fix(dashboard): a failed active-dashboard read keeps the dashboard list [skip ci] Since #1945 the list and the active dashboard are asked for together with Promise.all, so a failing active read dropped the list too (the golden 'active fails' case). It now degrades to no active dashboard. Golden re-recorded (parallel call in 'both fail'). Also: duplicate 'No group' in l10n/nl.js and an import-order lint error, both red on development. Assisted-by: ClaudeCode:claude-opus-5-5 --- l10n/nl.js | 1 - .../__tests__/fixtures/dashboard.golden.json | 5 ++++- src/stores/dashboard.js | 19 ++++++++++++++++++- src/utils/__tests__/adminWalkthrough.spec.js | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/l10n/nl.js b/l10n/nl.js index cab4fdc29..1462a0be7 100644 --- a/l10n/nl.js +++ b/l10n/nl.js @@ -2595,7 +2595,6 @@ OC.L10N.register( "Launchpad stays open." : "Launchpad blijft open.", "Legacy Windows program" : "Oud Windows-programma", "Most used first" : "Meest gebruikt eerst", - "No group" : "Geen groep", "None chosen: the tile opens as the dashboard decides." : "Niets gekozen: de tegel opent zoals het dashboard bepaalt.", "Not checked yet" : "Nog niet gecontroleerd", "Not reachable at the last check, {when}" : "Niet bereikbaar bij de laatste controle, {when}", diff --git a/src/stores/__tests__/fixtures/dashboard.golden.json b/src/stores/__tests__/fixtures/dashboard.golden.json index 71fd85b63..4a8afc06c 100644 --- a/src/stores/__tests__/fixtures/dashboard.golden.json +++ b/src/stores/__tests__/fixtures/dashboard.golden.json @@ -1013,6 +1013,9 @@ ], "getVisibleDashboards": [ [] + ], + "getActiveDashboard": [ + [] ] }, "toasts": [], @@ -1058,7 +1061,7 @@ "warnings": [], "errors": [ [ - "Failed to load dashboards:", + "Failed to load the active dashboard:", "Error: active down" ] ] diff --git a/src/stores/dashboard.js b/src/stores/dashboard.js index 74c30c1ee..e1ff99936 100644 --- a/src/stores/dashboard.js +++ b/src/stores/dashboard.js @@ -118,7 +118,24 @@ function firstDashboardResponses() { if (firstLoad !== null) { return Promise.resolve([{ data: firstLoad.visible }, { data: firstLoad.active }]) } - return Promise.all([fetchVisibleDashboards(), api.getActiveDashboard()]) + return Promise.all([fetchVisibleDashboards(), fetchActiveDashboard()]) +} + +/** + * Fetch the active dashboard. It is asked for together with the list, so a + * failure here must not take the list down with it: the load then has no + * active dashboard, as it had when the two were asked for one after the other. + * + * @return {Promise<{data: (object|null)}>} The axios response, or an empty one. + * @spec openspec/changes/archive/2026-11-25-dashboard-first-load-from-initial-state/tasks.md#task-3 + */ +async function fetchActiveDashboard() { + try { + return await api.getActiveDashboard() + } catch (error) { + logger.error('Failed to load the active dashboard:', error) + return { data: null } + } } /** diff --git a/src/utils/__tests__/adminWalkthrough.spec.js b/src/utils/__tests__/adminWalkthrough.spec.js index 33b89a033..c0dafa4de 100644 --- a/src/utils/__tests__/adminWalkthrough.spec.js +++ b/src/utils/__tests__/adminWalkthrough.spec.js @@ -10,9 +10,9 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import manifest from '../../manifest.json' import { ADMIN_TOUR_COMPLETION_KEY, - ADMIN_TOUR_WALKTHROUGH_KEY, ADMIN_TOUR_ID, ADMIN_TOUR_STORAGE_SUFFIX, + ADMIN_TOUR_WALKTHROUGH_KEY, adminTourManifest, adminTourStorage, loadAdminTourSeen,