-
Notifications
You must be signed in to change notification settings - Fork 2
perf fix sciweave #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
262f6a4
e13a699
360534c
5f5b04c
0eeb76b
0ac5dec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22.15 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| # DeSci Nodes Admin v2 | ||
|
|
||
| This repo is for the next version of the [DeSci Nodes Web v1 web app](https://github.com/desci-labs/nodes-web). | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
| yarn | ||
| yarn dev | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ import { NODES_API_URL } from "@/lib/config"; | |
| import { cookies } from "next/headers"; | ||
| import { NextResponse } from "next/server"; | ||
|
|
||
| export const maxDuration = 300; | ||
|
|
||
| export async function GET(_request: Request) { | ||
| try { | ||
| const response = await fetch( | ||
|
|
@@ -14,7 +16,27 @@ export async function GET(_request: Request) { | |
| }, | ||
| } | ||
| ); | ||
| return response | ||
|
|
||
| if (!response.ok) { | ||
| return NextResponse.json( | ||
| { error: "Failed to fetch report" }, | ||
| { status: response.status } | ||
| ); | ||
| } | ||
|
|
||
| if (!response.body) { | ||
| return NextResponse.json( | ||
| { error: "Missing response body" }, | ||
| { status: 502 } | ||
| ); | ||
| } | ||
|
|
||
| return new Response(response.body, { | ||
| headers: { | ||
| "Content-Type": "text/csv", | ||
| "Content-Disposition": 'attachment; filename="report.csv"', | ||
| }, | ||
| }); | ||
| } catch (err) { | ||
| return NextResponse.json({ error: err }, { status: 500 }); | ||
| } | ||
|
Comment on lines
40
to
42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same error serialization issue as in
🤖 Prompt for AI Agents |
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,8 @@ import { NODES_API_URL } from "@/lib/config"; | |||||||||||||||||||
| import { cookies } from "next/headers"; | ||||||||||||||||||||
| import { NextResponse } from "next/server"; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const maxDuration = 300; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export async function GET(request: Request) { | ||||||||||||||||||||
| try { | ||||||||||||||||||||
| const url = new URL(request.url); | ||||||||||||||||||||
|
|
@@ -15,7 +17,27 @@ export async function GET(request: Request) { | |||||||||||||||||||
| }, | ||||||||||||||||||||
| } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| return response | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if (!response.ok) { | ||||||||||||||||||||
| return NextResponse.json( | ||||||||||||||||||||
| { error: "Failed to fetch report" }, | ||||||||||||||||||||
| { status: response.status } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if (!response.body) { | ||||||||||||||||||||
| return NextResponse.json( | ||||||||||||||||||||
| { error: "Missing response body" }, | ||||||||||||||||||||
| { status: 502 } | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| return new Response(response.body, { | ||||||||||||||||||||
| headers: { | ||||||||||||||||||||
| "Content-Type": "text/csv", | ||||||||||||||||||||
| "Content-Disposition": 'attachment; filename="report.csv"', | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| }); | ||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||
| return NextResponse.json({ error: err }, { status: 500 }); | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
Comment on lines
41
to
43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error objects don't serialize to JSON properly.
Proposed fix } catch (err) {
- return NextResponse.json({ error: err }, { status: 500 });
+ return NextResponse.json(
+ { error: err instanceof Error ? err.message : "Internal server error" },
+ { status: 500 }
+ );
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: desci-labs/desci-admin
Length of output: 150
🏁 Script executed:
cat -n .env.example | tail -5Repository: desci-labs/desci-admin
Length of output: 199
Add a trailing newline at the end of the file.
The file still lacks a newline after line 21. Add a single blank line to the end of
.env.example.🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 21-21: [UnorderedKey] The SCIWEAVE_SUPABASE_SERVICE_KEY key should go before the SCIWEAVE_SUPABASE_URL key
(UnorderedKey)
🤖 Prompt for AI Agents