fix(frontend): navigate only by using actor ids#5023
Conversation
|
🚅 Deployed to the rivet-pr-5023 environment in rivet-frontend
|
PR Review: fix(frontend): navigate only by using actor idsOverviewThis PR simplifies the actor navigation model by removing the dual Bug Fix (Correct)In both route loaders ( const firstActorId = actors.pages[0]?.actors?.[0]?.key;This was using the actor's Issues1. Silent try {
await queryClient.fetchQuery(dataProvider.actorQueryOptions(trimmed));
// ...
return;
} catch {}An empty catch block swallows all errors silently, including unexpected ones (network failures, malformed responses, etc.). The intent is to fall through to the key-based lookup when an ID isn't found, but the current form also masks real errors. Consider only catching a specific "not found" condition, or at minimum logging in dev mode. 2. Potentially expensive parallel requests in const resolved = await Promise.any(
buildNames.map((name) =>
queryClient.fetchQuery(
dataProvider.actorQueryOptions({ key: trimmed, name }),
),
),
).catch(() => null);This fires one request per build name simultaneously. If a project has many builds, this triggers N parallel fetches for the key-resolution fallback. For an explicit user action this may be acceptable, but a comment explaining why 3. Leftover const { actorId, n } = useSearch({ from: '/_context' });
4. When Positive Changes
SummaryThe direction is right and the core bug fix ( |
c92292f to
1fd52f8
Compare
339b52a to
22e8455
Compare
22e8455 to
a29da76
Compare
a29da76 to
f4118ca
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: