Fix dashboard recent applications links#441
Conversation
Greptile SummaryThis PR fixes a bug where the "Recent Applications" section on the dashboard could render broken
Confidence Score: 4/5Safe to merge — the single-line change is targeted and directly addresses the broken link bug without touching any other query or rendering logic. The inner-join fix is correct and well-scoped. The only outstanding concern is a pre-existing edge case where a deleted user profile leaves a null applicant embed, which renders a blank name rather than breaking — not introduced by this PR. No files require special attention beyond src/app/dashboard/page.tsx, where the applicant join could also benefit from an inner-join guard in a follow-up. Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant DashboardPage
participant Supabase
Browser->>DashboardPage: GET /dashboard
DashboardPage->>Supabase: auth.getUser()
Supabase-->>DashboardPage: user
Note over DashboardPage,Supabase: Before fix (LEFT JOIN)
DashboardPage->>Supabase: "SELECT applications + gigs!gig_id WHERE gig.poster_id = user.id"
Supabase-->>DashboardPage: "rows including gig=null (orphaned/unowned)"
DashboardPage-->>Browser: renders /gigs/undefined links
Note over DashboardPage,Supabase: After fix (INNER JOIN)
DashboardPage->>Supabase: "SELECT applications + gigs!inner!gig_id WHERE gig.poster_id = user.id"
Supabase-->>DashboardPage: only rows where gig exists AND poster_id matches
DashboardPage-->>Browser: "renders /gigs/{id} links correctly"
|
Fixes #435.
The dashboard Recent Applications query filters on
gig.poster_idwhile using a left join, which keeps application rows where the joined gig is null. Those rows can render links to/gigs/undefined.This changes the gig join to an inner join so only applications for gigs owned by the current user are returned.
Tests:
git diff --check