Skip to content

fix(crud): append default opts map to varargs upsert for CRUD 1.5.0#101

Draft
dkasimovskiy wants to merge 1 commit into
masterfrom
fix/crud-upsert-parse-error-3.5.0
Draft

fix(crud): append default opts map to varargs upsert for CRUD 1.5.0#101
dkasimovskiy wants to merge 1 commit into
masterfrom
fix/crud-upsert-parse-error-3.5.0

Conversation

@dkasimovskiy

Copy link
Copy Markdown
Contributor

The varargs upsert(Options, Object...) and upsertObject(Options, Object...) overloads forwarded their arguments straight to iprotoCall, producing a 3-arg wire call crud.upsert(space, tuple, operations) with no opts table.

CRUD rock 1.5.0 (bundled with Tarantool 3.5.0) interprets that 3-arg form differently: crud/compare/conditions.lua:93 rejects the operations list with ParseConditionError: Each condition should be table, got "string" (condition 1). The 4-arg form (space, tuple, operations, opts) works because that overload delegates through toTupleOperationsOptsArgs.

Fix: append DEFAULT_UPDATE_OPTIONS.getOptions() to the argument list when the caller has not already supplied an opts map (detected by checking whether the last varargs element is a Map). The instanceof Map guard preserves the existing 4-arg call from testUpsertParameters, which deliberately passes its own options map.

Fixes TarantoolCrudClientTest#testUpsert on Tarantool 3.5.0.

I haven't forgotten about:

  • Tests
  • Changelog
  • Documentation
    • JavaDoc was written
  • Commit messages comply with the guideline
  • Cleanup the code for review. See checklist

Related issues:

The varargs \`upsert(Options, Object...)\` and \`upsertObject(Options, Object...)\`
overloads forwarded their \`arguments\` straight to \`iprotoCall\`, producing a
3-arg wire call \`crud.upsert(space, tuple, operations)\` with no opts table.

CRUD rock 1.5.0+ (bundled with Tarantool 3.5.0) rejects that 3-arg form at
\`crud/compare/conditions.lua:93\` with \`ParseConditionError: Each condition
should be table, got "string" (condition 1)\`. The 4-arg form
\`(space, tuple, operations, opts)\` works because that overload delegates
through \`toTupleOperationsOptsArgs\`.

Fix: append \`DEFAULT_UPDATE_OPTIONS.getOptions()\` to the args when the caller
has not already supplied an opts map (last varargs element not a \`Map\`). The
guard preserves the existing 4-arg call from \`testUpsertParameters\`, which
deliberately passes its own options map.

Fixes \`TarantoolCrudClientTest#testUpsert\` on Tarantool 3.5.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dkasimovskiy dkasimovskiy force-pushed the fix/crud-upsert-parse-error-3.5.0 branch from 56c93ab to efcf1ca Compare June 19, 2026 11:03
@dkasimovskiy dkasimovskiy requested a review from nickkkccc June 19, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant