ignore property values that are not strings #30488
Closed
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.
Technical Summary
It is possible for forms to have certain errors that cause HQ to save case property updates in non-string formats (specifically a dictionary in this case). This changes the case search index to not index (but still include in the saved doc) case properties whose values are not strings. This is the same thing we do with overly long case properties, and for the date and numeric versions of string values. Currently these docs just hard fail on attempting to save in the case search index
Tagged everyone who has case search ES context or form processor context, although since the properties are still available in the doc, just not searchable, I don't think this really commits us to any specific action with how we handle the form processing part of this issue.
More details in https://dimagi-dev.atlassian.net/browse/SAAS-12687 with the example cases, the forms that created them, and how that happened, as well as some context from a brief conversation I had with Clayton.
Feature Flag
Case Search and Case List Explorer
Safety Assurance
Safety story
I will test this on staging, but we use the same option in other parts of the mapping file, and this is broadly equivalent to #30009 for a different set of issues.
Rollback instructions
To rollback this change, the PR must be reverted and then
cchq <env> django-manage update_es_mapping case_search
must be run on all environments on which it was deployed.