improvement(release): code cleanup#4069
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Cleans up the form submission API to stop parsing SSE payloads and instead simply drain the stream until completion. Adjusts the resume API to run the synchronous JSON response path only when the stored execution mode is explicitly Reviewed by Cursor Bugbot for commit a6ed00b. Configure here. |
Greptile SummaryThis PR removes dead SSE-parsing code from the form submission route, tightens the sync-mode guard in the resume route from Confidence Score: 5/5Safe to merge — all three changes are correct cleanups with no behavioral regressions. Dead code removal in form route is unambiguous. The resume route guard change ( No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/form/[identifier]/route.ts | Removes dead SSE-parsing code (unused lastOutput variable, TextDecoder, line-splitting, JSON parse) from stream drain loop — replaced with a simpler drain-only loop. |
| apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.ts | Changes sync-mode guard from executionMode !== 'async' to the more explicit executionMode === 'sync', making each execution-mode branch mutually exclusive and clearer. |
| apps/docs/content/docs/en/blocks/human-in-the-loop.mdx | Updates async-mode resume docs to show the actual response shape (with jobId/statusUrl) and adds the /api/jobs/{jobId} polling endpoint — correcting previously stale documentation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[POST /api/resume] --> B{isApiCaller?}
B -- No --> F[Fire-and-forget\nstartResumeExecution]
B -- Yes --> C{executionMode}
C -- stream --> D[SSE streaming response\nwith SSE_HEADERS]
C -- sync --> E[Await startResumeExecution\nReturn JSON result]
C -- async --> G[Enqueue BullMQ/job-queue\nReturn 202 + jobId + statusUrl]
G --> H[GET /api/jobs/jobId\nPoll for completion]
Reviews (1): Last reviewed commit: "improvement(release): address comments" | Re-trigger Greptile
Summary
Dead code from forms sse route.
Type of Change
Testing
N/A
Checklist