Repository navigation
fix(frontend): salvage dashboard server visibility stability - #173
LucasSantana-Dev wants to merge 9 commits into
Conversation
✅ Deploy Preview for regal-bunny-0c8efe ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughBackend adds per-guild authorization resilience and centralized error mapping (401/403/502); Discord permission parsing supports dual formats; frontend removes /servers route guard and auto-selects servers where bot is installed; server selector distinguishes auth failures from empty states with actionable CTAs. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Frontend as Frontend Store
participant Routes as /api/guilds Routes
participant GuildAccessService
participant OAuth as DiscordOAuthService
participant API as Discord API
Client->>Frontend: Trigger guild fetch (isAuthenticated)
Frontend->>Routes: GET /api/guilds (with requestId)
Routes->>GuildAccessService: listAuthorizedGuilds(sessionData)
loop For each guild
GuildAccessService->>OAuth: resolveGuildContext(sessionData, guildId)
par Bot presence check
OAuth->>API: GET /users/@me/guilds
and Member context fetch
OAuth->>API: GET /guilds/{id}/members/@me
end
alt API returns 401/403/429/5xx
OAuth-->>GuildAccessService: Error with statusCode
GuildAccessService->>GuildAccessService: mapGuildAccessError (classify)
GuildAccessService->>GuildAccessService: Log failure, continue to next
else API succeeds
OAuth-->>GuildAccessService: Guild context
GuildAccessService->>GuildAccessService: Add to results
end
end
alt All guilds failed
GuildAccessService-->>Routes: AppError 502
Routes-->>Frontend: 502 (Upstream unavailable)
Frontend->>Frontend: Set guildLoadError.kind='upstream'
else Some guilds succeeded
GuildAccessService-->>Routes: List of guild contexts
Routes-->>Frontend: 200 with partial results
Frontend->>Frontend: Auto-select first botAdded guild
end
Frontend->>Client: Update UI with server list or error state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing this salvage PR because #169 merged directly before salvage merge. Diff is now redundant against main (only changelog line drift). |
## Problem `lucky-frontend` reports a permanent **false-positive `unhealthy`** (the app serves fine). Its `Dockerfile` HEALTHCHECK (production-frontend stage, `nginx-unprivileged:1.31-alpine`) uses `sh -c 'exec 3<>/dev/tcp/127.0.0.1/8080 …'` — but `/dev/tcp` is a **bash builtin**, and alpine's `sh` is busybox `ash`, which has no `/dev/tcp`. So the probe could never run. ## Fix Use busybox `wget` (present at `/usr/bin/wget`) against the unprivileged `:8080` listener: `wget -q --spider http://127.0.0.1:8080/`. **Validated live** in the running container (`WGET_SPIDER_OK`). Part of the same healthcheck-probe-mismatch class as homelab PR #173 + ADR-0018 and the lucky-bot fix #1105.
Summary
Validation
Notes
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
Improvements