Repository navigation
feat: artifacts integration web - #477
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56da906bd7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Get user ID from JWT token (set by auth middleware) | ||
| userID := extractUserIDFromToken(c) | ||
| if userID == "" { | ||
| c.JSON(http.StatusUnauthorized, gin.H{"error": "user not authenticated"}) |
There was a problem hiding this comment.
Honor Kong-authenticated user IDs in artifacts list
The new List handler only derives the user ID from a JWT in auth_token; when requests come through Kong, the auth middleware accepts them via X-User-ID and sets user_id on the context without setting auth_token (see services/response-api/internal/infrastructure/auth/auth.go). In that common deployment path, this handler will return 401 for valid, authenticated users, making /v1/artifacts unusable behind the gateway. Consider falling back to c.Get("user_id") (or a shared helper) before rejecting the request.
Useful? React with 👍 / 👎.
| fetchArtifacts: async () => { | ||
| // Prevent duplicate fetches | ||
| if (fetchPromise) { | ||
| return fetchPromise; | ||
| } |
There was a problem hiding this comment.
Avoid dropping refetches when filters change
The global fetchPromise guard prevents any new fetchArtifacts call while a request is in flight. If the user changes the search query or content-type filter before the previous request finishes, the new fetch is skipped and the store is updated with results for the old filters, leaving the gallery out of sync until another manual refresh. Consider keying the in-flight request by filter/search (or cancelling/ignoring stale responses) so the latest user intent always triggers a fetch.
Useful? React with 👍 / 👎.
Describe Your Changes
Summary
Changes
Backend (response-api)
Backend (mcp-tools)
Frontend (web)
Fixes Issues
Self Checklist