Skip to content

Commit 39a40bf

Browse files
Merge fix-loaded-signal-revert: Revert snapshot.loaded to .some() for reachable signal (#90, #91, #92)
2 parents b4bcc8e + 31c46d9 commit 39a40bf

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

frontend/src/app.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,16 +1744,15 @@ async function refreshOperationsWorkSnapshot(options = {}) {
17441744
]);
17451745

17461746
const snapshot = emptyOperationsWorkSnapshot();
1747-
// The home "work loaded" signal must only flip true once the work snapshot
1748-
// is actually current enough to render lane rows and resolved names. Using
1749-
// .some() let the signal go true when only one of the five work fetches
1750-
// resolved, so a slow/pending today-tasks (or users/bundles) fetch left the
1751-
// signal saying "loaded" while the lane row and assignee/workflow names were
1752-
// absent — a flaky single-visibility check in the e2e specs. Require every
1753-
// required work fetch to settle successfully; /api/me is optional because
1754-
// operator scoping degrades gracefully (currentOperatorId "" shows all tasks).
1755-
const requiredResults = [todayResult, overdueResult, waitingResult, bundlesResult, usersResult];
1756-
snapshot.loaded = requiredResults.every((result) => result.status === "fulfilled");
1747+
// The "work loaded" signal is a coarse "the work snapshot has fetched" gate,
1748+
// not a precision guarantee. .some() flips true once any of the required work
1749+
// fetches resolves, which is enough for the home to start rendering. This is
1750+
// intentionally permissive: on a partial outage the Today lane can render with
1751+
// available data while names degrade to ---, instead of hiding everything
1752+
// behind a never-true signal. The real robustness for stale snapshots lives in
1753+
// the e2e specs' retry-with-refresh loop, not in making this signal precise.
1754+
// (See #97 for finer per-lane degradation tracking.) /api/me is optional.
1755+
snapshot.loaded = [todayResult, overdueResult, waitingResult, bundlesResult, usersResult].some((result) => result.status === "fulfilled");
17571756
snapshot.todayTasks = tasksFromWorkPayload(settledPayload(todayResult));
17581757
snapshot.overdueTasks = tasksFromWorkPayload(settledPayload(overdueResult));
17591758
snapshot.waitingTasks = tasksFromWorkPayload(settledPayload(waitingResult));

0 commit comments

Comments
 (0)