fix(contacts): coerce numeric values to strings in text custom attribute filters - #15558
Draft
ar1vit0r wants to merge 1 commit into
Draft
Conversation
…ute filters When a numeric JSON value (e.g. 12345678901) was sent for a text custom attribute, PostgreSQL received an integer bind param for a ::text cast, causing a type mismatch 500. - Add coerce_text_attribute_values to FilterService for text attrs - Override filter_operation in Contacts::Conversations FilterService - Fix values_for_ilike to call .to_s before .strip (contains path) Closes chatwoot#15519
ar1vit0r
force-pushed
the
fix/15519-contacts-filter-numeric-text-attribute
branch
from
August 21, 2026 22:30
ac3d05c to
acb326b
Compare
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.
Description
When a numeric JSON value (e.g.
12345678901) is sent for a text custom attribute, PostgreSQL receives an integer bind param for a::textcast, causing a type mismatch → HTTP 500.This affects both the contacts filter (
POST /api/v1/accounts/{id}/contacts/filter) and the conversations filter (POST /api/v1/accounts/{id}/conversations/filter).Closes #15519
Type of change
How Has This Been Tested?
spec/services/contacts/filter_service_spec.rb:equal_tofilter with integer value on text custom attributecontainsfilter with integer value on text custom attributeChecklist