Karthikeya1500 opened a new pull request, #5941: URL: https://github.com/apache/couchdb/pull/5941
## Overview This PR fixes a bug in the QuickJS query server dispatcher (`dispatch-quickjs.js`). ## Details In `globalThis.dispatch`, `cmd.shift()` was being executed inline within the `switch` statement. If an unrecognized default command gets processed, the error handler attempts to reference `cmdkey` which was never defined. This causes the query server to throw a standard JavaScript `ReferenceError`, preventing the intended CouchDB structured error array from reaching the parent database process. This fix correctly assigns `const cmdkey = cmd.shift();` before evaluating the `switch` statement so that unrecognized commands can be gracefully handled and logged. ## Checklist - [x] Fix addresses a specific, isolated issue - [x] Safe, non-breaking change -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
