fix: map Mongo duplicate key error to DuplicatedJobError - #217
Merged
GiovaniGuizzo merged 2 commits intoSep 22, 2026
Merged
GiovaniGuizzo merged 2 commits into
GiovaniGuizzo merged 2 commits into
Conversation
Tyagiquamar
requested review from
GiovaniGuizzo and
merencia
as code owners
September 21, 2026 14:17
GiovaniGuizzo
previously approved these changes
Sep 21, 2026
Contributor
|
Approved! Thanks for your contribution, @Tyagiquamar! |
merencia
previously approved these changes
Sep 21, 2026
Contributor
|
@Tyagiquamar there are failures now on MySQL. Can you please apply the same fix to that backend driver? |
MySQL reports unique_digest collisions as ER_DUP_ENTRY (errno 1062) with key sidequest_jobs.sidequest_jobs_unique_digest_unique, which did not match the previous sidequest_jobs.unique_digest check. createNewJob now maps those failures to DuplicatedJobError, matching the Mongo backend contract. Co-authored-by: Cursor <cursoragent@cursor.com>
Tyagiquamar
dismissed stale reviews from merencia and GiovaniGuizzo
via
September 22, 2026 07:19
c71b38d
Contributor
Author
|
@GiovaniGuizzo applied the same mapping on the MySQL driver. The previously failing conformance cases ( |
GiovaniGuizzo
approved these changes
Sep 22, 2026
Contributor
|
Merged! Thanks, @Tyagiquamar for your contribution |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #216 (follow-up to closed #85).
Was: MongoBackend.createNewJob did a bare insertOne, so a duplicate unique_digest surfaced as a raw MongoServerError E11000 while the SQL drivers throw DuplicatedJobError.
Now: duplicate-key failures (code 11000 / E11000 / unique_digest) throw DuplicatedJobError, and the conformance suite pins all drivers to that contract.
Where to look:
Tested: mongo conformance suite 85 passed against mongo:7 (MONGODB_URL 127.0.0.1:27777); eslint clean on both files. SQLite suite cannot run here (better-sqlite3 native bindings missing on Windows, fails at migration before any assertion).