Conversation
| XMTPD_API_PORT: String(port), | ||
| XMTPD_API_ENABLE: "true", |
There was a problem hiding this comment.
does it need the API? Thats a lot of computation for nothing
There was a problem hiding this comment.
for now just testing, will clean it up later.
|
|
||
| on: | ||
| push: | ||
| branches: [main, dev] |
|
@mchenani this particular implementation of the gateway does not support any extensions or JWT token auth. Does that meet your requirements? |
Thanks for the review, tbh I'm not sure if I'm aware of the requirements there, will discuss them with @cameronvoell to make sure I have the full picture how we want to tackle that. |
Changes since #1622 opened
📊 Macroscope summarized 265ca0d. 11 files reviewed, 9 issues evaluated, 4 issues filtered, 1 comment posted. View details |
| function setupLogForwarding(child: ChildProcess): void { | ||
| let buffer = ""; | ||
| child.stdout?.on("data", (data: Buffer) => { | ||
| buffer += data.toString(); |
There was a problem hiding this comment.
🟡 Medium
src/process-manager.ts:90 The buffer grows unbounded if stdout never emits newlines. Consider capping buffer size (e.g., 1MB) and discarding/truncating when exceeded, or document why this is acceptable for the expected gateway output format.
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around line 90:
The `buffer` grows unbounded if stdout never emits newlines. Consider capping buffer size (e.g., 1MB) and discarding/truncating when exceeded, or document why this is acceptable for the expected gateway output format.
|
|
||
| const timeout = config.healthCheckTimeout ?? 30_000; | ||
| try { | ||
| await Promise.race([waitForHealthy(port, timeout), earlyExit]); |
There was a problem hiding this comment.
🟡 Medium
src/process-manager.ts:42 Consider verifying the gateway actually bound to the port, not just that the port is in use. If another process occupies the port, waitForHealthy succeeds immediately while the gateway fails to bind. One option: hit the gateway's health endpoint instead of just checking port occupancy.
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around line 42:
Consider verifying the gateway actually bound to the port, not just that the port is in use. If another process occupies the port, `waitForHealthy` succeeds immediately while the gateway fails to bind. One option: hit the gateway's health endpoint instead of just checking port occupancy.
| server.once("listening", () => { | ||
| server.close(); | ||
| resolve(false); |
There was a problem hiding this comment.
🟡 Medium
src/process-manager.ts:148 Consider waiting for the close event before resolving, since server.close() is asynchronous and the port may not be released yet when findAvailablePort returns.
| server.once("listening", () => { | |
| server.close(); | |
| resolve(false); | |
| server.once("listening", () => { | |
| server.close(() => resolve(false)); | |
| }); |
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around lines 148-150:
Consider waiting for the `close` event before resolving, since `server.close()` is asynchronous and the port may not be released yet when `findAvailablePort` returns.
| echo " Building ${goos}/${goarch} -> ${output}" | ||
| CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \ |
There was a problem hiding this comment.
🟠 High
npm/build.sh:15 go build -o doesn't create parent directories. Consider adding mkdir -p "$(dirname "${output}")" before the build command.
| echo " Building ${goos}/${goarch} -> ${output}" | |
| CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \ | |
| echo " Building ${goos}/${goarch} -> ${output}" | |
| mkdir -p "$(dirname "${output}")" | |
| CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \ |
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file npm/build.sh around lines 15-16:
`go build -o` doesn't create parent directories. Consider adding `mkdir -p "$(dirname "${output}")"` before the build command.
No description provided.