Fix array-type filter conditions (ObjectsFilterItem, MultiSelectFilterItem)#2914
Open
themightychris wants to merge 3 commits intoanyproto:developfrom
Open
Fix array-type filter conditions (ObjectsFilterItem, MultiSelectFilterItem)#2914themightychris wants to merge 3 commits intoanyproto:developfrom
themightychris wants to merge 3 commits intoanyproto:developfrom
Conversation
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Author
|
Note: This PR has significant overlap with #2880 by @stevelr, which also fixes the Differences:
Both PRs address the core issue reported in #2897. It may make sense to combine the special cases from both approaches. |
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 1, 2026
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 2, 2026
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 2, 2026
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 2, 2026
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 3, 2026
Tests for: - ObjectsFilterItem with 'in' condition on links property - ObjectsFilterItem with 'all' condition on assignee property - SanitizeAndValidatePropertyValue accepting []string input - links property allowing filtering by any object type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Bug 1: SanitizeAndValidatePropertyValue now accepts both []string
(from ObjectsFilterItem.GetValue()) and []interface{} (from JSON)
for objects/files property formats.
Bug 2: Added isValidObjectReferenceForProperty() that relaxes
validation for the "links" property - it only checks that the
object exists, without requiring a specific layout. This allows
filtering by any object type (files, types, pages, etc.)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Same bug as ObjectsFilterItem: SanitizeAndValidatePropertyValue
now accepts both []string (from MultiSelectFilterItem.GetValue())
and []interface{} (from JSON) for multi_select property format.
Closes anyproto#2897
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43481ba to
bc7dc50
Compare
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 3, 2026
themightychris
added a commit
to themightychris/anytype-heart
that referenced
this pull request
Feb 3, 2026
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.
Summary
Fixes the
failed to build expression filterserror when usingin,all, orninconditions on array-type properties (objects,multi_select,files) in the Search API.Problem
The filter item types (
ObjectsFilterItem,MultiSelectFilterItem,FilesFilterItem) return[]stringfrom theirGetValue()methods, butSanitizeAndValidatePropertyValueexpected[]interface{}. This type assertion failure caused all array-based filter conditions to fail.Additionally, the
linksproperty (a derived system property) was incorrectly validated to require object/member layouts, but it can contain references to any object type (files, types, pages, etc.).Changes
core/api/service/property.go:SanitizeAndValidatePropertyValuenow accepts both[]stringand[]interface{}forobjects,files, andmulti_selectproperty formatsisValidObjectReferenceForProperty()that relaxes validation for thelinkspropertycore/api/filter/expression_test.go: Added tests forObjectsFilterItemwithin/allconditionscore/api/service/property_test.go: Added tests forSanitizeAndValidatePropertyValuehandling[]stringinput for objects and multi_select formatsTest Plan
[]stringinput is accepted for objects properties[]stringinput is accepted for multi_select propertieslinksproperty accepts any object type (e.g., files)Fixes #2897
🤖 Generated with Claude Code