The feed doesn't say "Empty" before its persona is known

On opening, the feed showed "Empty" until the session had been read and a persona chosen, then loaded: a flash of a
wrong answer on every start (and the end-to-end sign-in took it for a loaded feed). CascadingState says once the session
has been read (IsSessionLoaded), and until then a feed with no persona yet is loading; a login without any persona still
gets its empty feed. The persona-switch test waits for the sibling's home read with another token than the first
persona's, instead of any home read after the switch was asked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-07 00:20:56 +02:00
1 parent 18331531b8
commit 47ff60f57b
3 files changed
+24 -7

No files matched your search

+14 -3
View File
@@ -155,6 +155,7 @@
(double Latitude, double Longitude)? position;
string positionError;
string loadedPersonaId;
bool waitingForPersona;
FeedQuery lastQuery;
DateTime? lastPollAt;
TimeSpan? lastLoadTook;
@@ -183,9 +184,11 @@
return;
}
// (while the session is still being read the persona isn't known yet: the feed is loading, not empty)
if (CascadingState.PersonaId is null)
{
IsLoading = false;
waitingForPersona = !CascadingState.IsSessionLoaded;
IsLoading = waitingForPersona;
return;
}
@@ -219,11 +222,19 @@
return true;
}
// The persona changed (NavMenu's switcher): everything on the page belongs to the old one.
// The persona is known (the session was read after the page opened) or changed (NavMenu's switcher): everything on the
// page belongs to it.
protected override async Task OnParametersSetAsync()
{
if (CascadingState.PersonaId is null || CascadingState.PersonaId == loadedPersonaId || IsLoading && loadedPersonaId is null)
if (waitingForPersona && CascadingState.IsSessionLoaded && CascadingState.PersonaId is null)
{
waitingForPersona = false;
IsLoading = false;
return;
}
if (CascadingState.PersonaId is null || CascadingState.PersonaId == loadedPersonaId || IsLoading && loadedPersonaId is null && !waitingForPersona)
return;
waitingForPersona = false;
await Reload();
}