You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes the HTTP-success validation-error path by removing the unused commentUrl argument from its debug log. That argument was evaluated before the later const commentUrl initialization, preventing the existing error handler from running in the source script, even with debugging disabled.
The extracted-error handling, submitting-guard cleanup, successful-comment path, and server validation policy are unchanged.
src/js/frontend/wp-ajaxify-comments.js: remove the premature debug argument.
dist/wpac-frontend-js.js and dist/wpac-frontend-js.asset.php: regenerate the combined frontend bundle and version.
dist/wpac-frontend-wp-ajaxify-comments.js and dist/wpac-frontend-wp-ajaxify-comments.asset.php: regenerate the standalone frontend bundle and version.
Generated assets come from the existing production webpack build. Unrelated generated output is excluded. No dependencies, server-side validation, repository test infrastructure, fixtures, or CI gates were changed.
Runtime Testing
Risk level: High — comment form handler.
Verification: runtime-verified for the changed frontend path.
Final pushed head:6e1c9a0ad29bd2c3122bffb1ed5aacd24c7789cd.
Runtime-tested revision:a2f2645d1ddc366c8be9063585d78c105b56aa4f. All five delivered source/asset files are byte-identical at the final head, verified with git diff --exit-code over those exact paths. Only history finalization and exclusion of automatically generated runtime bookkeeping followed the browser run. Existing lint and syntax checks were repeated on the final head.
Environment: Node 22.22.2, webpack 5.111.1, ESLint 8.57.1, jQuery 3.7.1, Chromium 152, and an existing WordPress 6.8.2 / PHP 8.2 local test site.
Acceptance matrix
Criterion
Result
Evidence
HTTP 2xx plus X-WPAC-ERROR: 1, debug off and on
Satisfied
Six browser cases across the source and both rebuilt bundles displayed the actual WordPress error, Error: Please type your comment text., replacing the loading message.
No ReferenceError; loading completes; submitting guard clears
Satisfied
All ten browser flows reached AJAX completion with WPAC_SUBMITTING false and no JavaScript exceptions.
Corrected comment can subsequently be submitted; ordinary success remains functional
Satisfied
After a validation error, a corrected real WordPress POST succeeded, emitted wpacAfterPostComment, displayed the awaiting-moderation success message, and retained one usable comment form.
Non-2xx validation failures remain handled
Satisfied
Three HTTP 400 browser cases, one per source/bundle, displayed the same extracted WordPress error and cleared the submitting guard.
Existing lint and build pass
Satisfied
Commands below passed; only the five authorized files are included.
Coverage limit: The existing local WordPress site did not have a deployed Ajaxify server plugin. The current source/bundles were loaded into its real comment page using the existing browser tooling. One-shot DevTools response overrides supplied the X-WPAC-ERROR header, HTTP 400 status for non-2xx cases, and successful-comment metadata normally supplied by the plugin. WordPress validation/page response bodies and the corrected POST were real. This is frontend-path runtime evidence, not an unmodified end-to-end deployment of the server plugin or a reproduction of the historical support-site redirect.
The existing pre-push hook passed frontend lint on the implementation pushes. Automatically regenerated, untracked runtime bookkeeping caused the hook to skip its final repetition; the explicit frontend lint and source/bundle/manifest syntax checks above were run successfully on the final pushed head instead. That bookkeeping is not in the final PR diff.
The production build exits successfully with existing Sass deprecation warnings in untouched SCSS and a babel-plugin-lodash deprecation notice. These are outside this source-only validation fix; their files and dependency declarations are unchanged.
Review
Direct diff/scope review: only the premature source argument and the four relevant generated artifacts changed.
Independent, inference-only source closeout review: no introduced P0/P1 defect found. The reviewer received the source deletion and adjacent callback contracts, not the generated bundles or full-site runtime.
Final-head branch evidence digest: c9475f33b3f131f20bdfa78659a3d99c96a5b3ed7b9b8ef60ccc032af453a1d4. The source/asset file contents reviewed and runtime-tested above are unchanged.
Rollback
Revert the scoped source and generated-asset changes together.
aidevops.sh v3.39.27 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 22m and 175,182 tokens on this as a headless worker.
Summary by CodeRabbit
Bug Fixes
Fixed an issue that could interrupt handling of errors returned when submitting comments asynchronously. Comment error responses are now handled without referencing the comment URL before it is available, helping prevent unexpected problems during the submission process.
Reviewing files that changed from the base of the PR and between 1bb0b9c and 6e1c9a0.
⛔ Files ignored due to path filters: 4
dist/wpac-frontend-js.asset.php is excluded by !**/dist/**
dist/wpac-frontend-js.js is excluded by !**/dist/**
dist/wpac-frontend-wp-ajaxify-comments.asset.php is excluded by !**/dist/**
dist/wpac-frontend-wp-ajaxify-comments.js is excluded by !**/dist/**
📒 Files selected for processing: 1
src/js/frontend/wp-ajaxify-comments.js
💤 Files with no reviewable changes: 1
src/js/frontend/wp-ajaxify-comments.js
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
The X-WPAC-ERROR branch no longer passes commentUrl to its debug call before the variable is declared.
The validation-error fix is present in the shipped assets, with no identified issue preventing merge after normal checks.
Pre-merge checks: 5
Passed checks: 5 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the main change: fixing AJAX validation-error response handling caused by premature commentUrl access.
Linked Issues check
Issue #79 requires removal of the premature commentUrl access while preserving error handling and normal comment behavior. The source change removes that debug argument. The PR summary reports regen…
Out of Scope Changes check
The reported changes are limited to the source fix and the four generated frontend assets listed by issue #79. The generated assets support the source change. The PR reports no dependency, server-side…
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
What: Remove the premature commentUrl debug argument from the HTTP-success X-WPAC-ERROR branch, allowing existing validation-error handling and completion cleanup to run.
Testing: Existing frontend ESLint with zero warnings, production webpack build, Node syntax checks for source and both bundles, PHP syntax checks for both asset manifests, and branch whitespace checks passed. Ten browser flows passed across the source and both production bundles: 2xx error-header responses with debug off/on, non-2xx validation responses, cleared submitting guards, and a corrected real WordPress POST with the ordinary awaiting-moderation success path. No JavaScript exceptions occurred during those final ten flows. The runtime-tested revision was a2f2645d1ddc366c8be9063585d78c105b56aa4f; all five delivered file blobs are identical at the final head, and lint/syntax checks were repeated there. Independent supplied-source review found no introduced P0/P1 defect.
Runtime coverage limit: The existing WordPress 6.8.2 local site had no deployed Ajaxify server plugin. Current frontend assets ran on its real comment page; one-shot DevTools overrides supplied status/header metadata while retaining actual WordPress response bodies and real POST handling. This is changed-frontend-path verification, not an unmodified server-plugin integration run or reproduction of the historical support report.
Key decisions: Preserve existing error extraction, success behavior, and server validation policy. Regenerate only the scoped frontend assets; no dependency, repository test-infrastructure, fixture, or CI changes. Untouched Sass/Babel deprecation warnings remain outside scope. The local test comment was reversibly trashed after verification, and the temporary asset server and browser were stopped.
aidevops.sh v3.39.27 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 22m and 175,182 tokens on this as a headless worker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the HTTP-success validation-error path by removing the unused
commentUrlargument from its debug log. That argument was evaluated before the laterconst commentUrlinitialization, preventing the existing error handler from running in the source script, even with debugging disabled.The extracted-error handling, submitting-guard cleanup, successful-comment path, and server validation policy are unchanged.
Resolves #79
Files Changed
src/js/frontend/wp-ajaxify-comments.js: remove the premature debug argument.dist/wpac-frontend-js.jsanddist/wpac-frontend-js.asset.php: regenerate the combined frontend bundle and version.dist/wpac-frontend-wp-ajaxify-comments.jsanddist/wpac-frontend-wp-ajaxify-comments.asset.php: regenerate the standalone frontend bundle and version.Generated assets come from the existing production webpack build. Unrelated generated output is excluded. No dependencies, server-side validation, repository test infrastructure, fixtures, or CI gates were changed.
Runtime Testing
6e1c9a0ad29bd2c3122bffb1ed5aacd24c7789cd.a2f2645d1ddc366c8be9063585d78c105b56aa4f. All five delivered source/asset files are byte-identical at the final head, verified withgit diff --exit-codeover those exact paths. Only history finalization and exclusion of automatically generated runtime bookkeeping followed the browser run. Existing lint and syntax checks were repeated on the final head.Acceptance matrix
X-WPAC-ERROR: 1, debug off and onError: Please type your comment text., replacing the loading message.WPAC_SUBMITTINGfalse and no JavaScript exceptions.wpacAfterPostComment, displayed the awaiting-moderation success message, and retained one usable comment form.Coverage limit: The existing local WordPress site did not have a deployed Ajaxify server plugin. The current source/bundles were loaded into its real comment page using the existing browser tooling. One-shot DevTools response overrides supplied the
X-WPAC-ERRORheader, HTTP 400 status for non-2xx cases, and successful-comment metadata normally supplied by the plugin. WordPress validation/page response bodies and the corrected POST were real. This is frontend-path runtime evidence, not an unmodified end-to-end deployment of the server plugin or a reproduction of the historical support-site redirect.Existing checks
npm ci --no-audit --no-fundnpm run lint:js -- --max-warnings=0npm run buildnode --check src/js/frontend/wp-ajaxify-comments.jsnode --check dist/wpac-frontend-js.jsnode --check dist/wpac-frontend-wp-ajaxify-comments.jsphp -l dist/wpac-frontend-js.asset.phpphp -l dist/wpac-frontend-wp-ajaxify-comments.asset.phpgit diff --check origin/main...HEADThe production build exits successfully with existing Sass deprecation warnings in untouched SCSS and a
babel-plugin-lodashdeprecation notice. These are outside this source-only validation fix; their files and dependency declarations are unchanged.Review
22610bc48894e83c03354f58573fab078a07cba40d22f5d3d4ce15b054021298.c9475f33b3f131f20bdfa78659a3d99c96a5b3ed7b9b8ef60ccc032af453a1d4. The source/asset file contents reviewed and runtime-tested above are unchanged.Rollback
Revert the scoped source and generated-asset changes together.
aidevops.sh v3.39.27 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 22m and 175,182 tokens on this as a headless worker.
Summary by CodeRabbit