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.
Product Description
Fixes a bug where the thing that copies user data to SQL choked on data that looked like a datetime stamp, causing 500s
Technical Summary
https://dimagi-dev.atlassian.net/browse/SUPPORT-18199
Introduced in #33688
If user data contains a datetime string, jsonobject parses it into a date object, which we can't send directly to a SQL json field. To address this, I use the json-compatible version of the user object and extract the user_data from that, using jsonobject's serialization.
A side effect of this change is that I cannot pass the object by reference, meaning updates to it are not passed back to couch. I think this is actually an improvement, as the prior behavior was inconsistent anyways (it'd only pass back when first initialized, and not thereafter).
Feature Flag
Safety Assurance
Safety story
Local testing, will deploy to staging first.
Automated test coverage
included
QA Plan
Rollback instructions
Labels & Review