Repository navigation
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/pages/download.tsx">
<violation number="1" location="src/pages/download.tsx:62">
P2: Concurrent requests to `/archive/:jobId` write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and `rename` it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Turn on auto-fix | Re-trigger cubic
| files[file] = Bun.file(path.join(outputPath, file)); | ||
| } | ||
| } | ||
| await Bun.Archive.write(outputTar, files); |
There was a problem hiding this comment.
P2: Concurrent requests to /archive/:jobId write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and rename it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/pages/download.tsx, line 62:
<comment>Concurrent requests to `/archive/:jobId` write the same archive path, so one response can stream a partially written or truncated tar. Write to a unique temp file and `rename` it into place. The temp file also needs to be excluded from the glob so other requests don't pack it.</comment>
<file context>
@@ -50,21 +50,17 @@ export const download = new Elysia()
- "Content-Type": "application/x-tar",
- },
- });
+ await Bun.Archive.write(outputTar, files);
+ return Bun.file(outputTar);
},
</file context>
Summary by cubic
Replaces the
tarpackage with Bun's native Archive API for creating download archives, removing the external dependency. Archives are written to disk at the job output path../prefix, so download listings and tests no longer include it.Bun.Archivedirectly.Written for commit dc26689. Summary will update on new commits.