Skip to content

Fix dashboard recent applications links#441

Closed
Autowebassat-blip wants to merge 1 commit into
profullstack:masterfrom
Autowebassat-blip:fix-435-dashboard-recent-applications-inner-join
Closed

Fix dashboard recent applications links#441
Autowebassat-blip wants to merge 1 commit into
profullstack:masterfrom
Autowebassat-blip:fix-435-dashboard-recent-applications-inner-join

Conversation

@Autowebassat-blip

Copy link
Copy Markdown
Contributor

Fixes #435.

The dashboard Recent Applications query filters on gig.poster_id while 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

@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a bug where the "Recent Applications" section on the dashboard could render broken /gigs/undefined links. The root cause was that a LEFT JOIN between applications and gigs meant that when the PostgREST embedded filter .eq(\"gig.poster_id\", user.id) was applied to a null-joined row, the gig embed was nulled out on the client side rather than the row being excluded.

  • Change: One-line addition in the Supabase select string — gigs!gig_idgigs!inner!gig_id — switches the join from LEFT to INNER, ensuring only applications with a matching, user-owned gig are returned.
  • Scope: Limited to src/app/dashboard/page.tsx; all other queries and rendering logic are unchanged.

Confidence Score: 4/5

Safe 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

Filename Overview
src/app/dashboard/page.tsx Switches the gig relationship join from LEFT to INNER (!inner!gig_id) to prevent null-gig application rows from surfacing on the dashboard; the existing .eq("gig.poster_id", user.id) filter remains correct for scoping results to the current user's gigs.

Sequence Diagram

sequenceDiagram
    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"
Loading

Comments Outside Diff (1)

  1. src/app/dashboard/page.tsx, line 107-110 (link)

    P2 Null applicant still possible after this fix

    The gig join is now inner, but the applicant:profiles!applicant_id join remains a LEFT JOIN. If a user account is deleted while their application persists, app.applicant will be null. Lines 429–430 use optional chaining so nothing crashes, but the card will silently render a blank applicant name rather than being filtered out. Consider adding !inner to the applicant join as well, or adding a null guard in the render to display a fallback ("Deleted user").

Reviews (1): Last reviewed commit: "Fix dashboard recent applications join" | Re-trigger Greptile

@ralyodio ralyodio closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard recent applications link to /gigs/undefined

2 participants