Skip to content

fix(attributes): attach the auto filter in the batch creation path - #967

Merged
abnegate merged 1 commit into
feat-query-libfrom
fix/batch-attribute-auto-filter
Sep 11, 2026
Merged

fix(attributes): attach the auto filter in the batch creation path#967
abnegate merged 1 commit into
feat-query-libfrom
fix/batch-attribute-auto-filter

Conversation

@abnegate

Copy link
Copy Markdown
Member

What

createAttributes() is the third public path that creates attributes, and it was the only one that never attached the type-named filter listed in Database::ATTRIBUTE_FILTER_TYPES. createAttribute() and createCollection() both attach it before validating.

This adds the same guard to the batch path, right after the "Missing attribute key" check.

Why it matters

The attribute validator requires that filter to be present, so a datetime, point, linestring, polygon, vector or object attribute created through the batch path was rejected outright:

Utopia\Database\Exception: Attribute of type: datetime requires the following filters: datetime

Had validation let it through, the value would have been stored without the encode/decode the other two paths apply — a datetime written as +05:00 would never have been normalised to +00:00.

Test

testCreateAttributesAddingAutoFilter creates a datetime attribute via createAttributes(), writes a +05:00 offset and asserts it reads back normalised to +00:00. It skips on adapters without Capability::BatchCreateAttributes.

Verified it is a real regression test — with the src/ change reverted it fails on the validator error above, and passes with the fix.

Verification

Check Result
Unit suite (paratest, 4 procs) 1606 tests, 6195 assertions — green
MariaDB adapter e2e 793 tests, 22975 assertions — green
composer lint (Pint, PSR-12) passed

🤖 Generated with Claude Code

createAttributes() is the third public path that creates attributes, and
it was the only one that never attached the type-named filter listed in
Database::ATTRIBUTE_FILTER_TYPES. createAttribute() and createCollection()
both attach it before validating.

The attribute validator requires that filter to be present, so a datetime,
point, linestring, polygon, vector or object attribute created through the
batch path was rejected outright with "Attribute of type: datetime requires
the following filters: datetime". Had validation let it through, the value
would have been stored without the encode/decode the other two paths apply
— a datetime written as +05:00 would never have been normalised to +00:00.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • 0.69.x

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 64bb3642-508f-4618-839b-63dc4a0817d0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the batch path now aligned with the established automatic-filter behavior.

Summary

  • Adds the type-named filter before batch attribute validation.
  • Deduplicates filters while preserving their effective order.
  • Adds an end-to-end datetime test proving offset normalization through the batch path.

Reviews (1) · Last reviewed commit: "fix(attributes): attach the auto filter ..."

@abnegate
abnegate merged commit ea6116c into feat-query-lib Sep 11, 2026
22 checks passed
@abnegate
abnegate deleted the fix/batch-attribute-auto-filter branch September 11, 2026 05:46
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