GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — feat(pm-stack): prompt submission store and widget (#10032, S1 of #9539) by dezren39 · Pull Request #12161 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 950949f316
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const tmp = `${this.path}.${process.pid}.tmp`; | ||
| await writeFile(tmp, JSON.stringify(file, null, 2)); | ||
| await rename(tmp, this.path); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Serialize concurrent prompt persistence
When two POST /api/prompt requests overlap, both persistence calls write to the same process-wide temporary pathname. Their writes can truncate or modify the same file, and once one call renames it, the other's rename can fail with ENOENT, causing a 500 response even though its record may already be stored. A write still in progress can also modify the published destination after the rename, defeating atomic persistence. Serialize the load/mutation/persistence sequence so overlapping submissions cannot corrupt the store or report spurious failures.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| `<form class="prompt-widget" method="post" action="/api/prompt"` + | ||
| ` data-scope="${opts.scope}" data-page="${escapeHtml(opts.page)}"${section}>` + |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Submit the widget payload as JSON
When this widget is rendered and its Send button is clicked, the browser submits URL-encoded form data, but the existing POST /api/prompt handler in server.ts passes the body to readJsonBody, which unconditionally calls JSON.parse. Every normal widget submission therefore receives HTTP 400 instead of creating a prompt. The existing submit handlers in render.ts only handle cform, raform, and aform, so none converts this widget's submission to JSON. Add a JSON submission handler or support form bodies at the endpoint.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.