Skip to content

migrate(chat): repoint /api/upload to recoup-api#1718

Open
arpitgupta1214 wants to merge 3 commits intotestfrom
migrate/upload-group2
Open

migrate(chat): repoint /api/upload to recoup-api#1718
arpitgupta1214 wants to merge 3 commits intotestfrom
migrate/upload-group2

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented Apr 28, 2026

Cuts over usePureFileAttachments and lib/arweave/uploadFile.tsx to the new dedicated POST /api/upload on api (group 2 of the chat→api migration), and removes the local route. Response shape is 1:1, so this is a base-URL swap.

Depends on api PR landing on test first (Arweave parity endpoint).

Test plan

  • After api PR is on test: upload a file via chat input — succeeds, attachment shows the Arweave URL
  • Profile-picture upload via Account settings (uses lib/arweave/uploadFile.tsx) succeeds

Summary by cubic

Repoints file uploads to the centralized recoup API and allows Supabase public URLs to render in next/image. Response shape is unchanged; returned URLs may be Supabase.

  • Refactors

    • Update hooks/usePureFileAttachments and lib/arweave/uploadFile.tsx to call POST /api/upload via getClientApiBaseUrl().
    • Remove local app/api/upload/route.ts.
    • Add *.supabase.co/storage/v1/object/public/** to images.remotePatterns in next.config.mjs for next/image.
  • Migration

    • Requires the API upload endpoint on test. Verify: chat input upload returns a working URL and profile photo upload succeeds.
    • Confirm images render via next/image when the URL is on *.supabase.co.

Written for commit 889363c. Summary will update on new commits.

Cuts over `usePureFileAttachments` and `lib/arweave/uploadFile.tsx` to
the new dedicated `POST /api/upload` on api (Arweave bytes proxy
parity), and removes the local route. The API response shape is 1:1, so
this is a base-URL swap. `lib/arweave/uploadToArweave.ts` is kept since
it's still imported by `lib/txtGeneration.ts` and `lib/ai/generateImage.ts`.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview May 8, 2026 3:29pm
recoup-chat Ready Ready Preview May 8, 2026 3:29pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@arpitgupta1214 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 55 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f985c6ad-8b02-4413-ad09-a22837e9f467

📥 Commits

Reviewing files that changed from the base of the PR and between 4d180dc and 889363c.

⛔ Files ignored due to path filters (1)
  • next.config.mjs is excluded by none and included by none
📒 Files selected for processing (3)
  • app/api/upload/route.ts
  • hooks/usePureFileAttachments.ts
  • lib/arweave/uploadFile.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch migrate/upload-group2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR migrates core file upload functionality to an external API and removes a local route, which involves high-impact infrastructure changes and external dependencies.

Phase-1 of the api-side Arweave→Supabase upload migration
(recoupable/api#492) returns Supabase public bucket URLs from
POST /api/upload. Add the hostname to next.config.mjs remotePatterns
so Next/Image can render them.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: This is a non-trivial refactor of the upload flow that changes the API endpoint from a local route to an external service, with a dependency on another PR. API changes, even if response shapes match,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant