Fix a migration wiping user info of users that don't have any mutes #5235

Closed
rinpatch wants to merge 3 commits from gitlab-mr-iid-1856 into gitlab-mr-base-iid-1856
Member

And introduce safe_jsonb_set

Closes #1324

And introduce safe_jsonb_set Closes #1324

raising will make the queyr error, right?

raising will make the queyr error, right?

Very nice, but can you add a test for the new function?

Very nice, but can you add a test for the new function?
Author
Member

Yes, it will abort the current transaction

Yes, it will abort the current transaction
Author
Member

Yeah, will do

Yeah, will do

So if this raises, is there no error reported?

So if this raises, is there no error reported?
Author
Member

This doesn't raise. jsonb_set wipes the column when you try to set the value to NULL, safe_jsonb_set has a coalesce which will call jsonb_set with 'null'::jsonb if asked to set the value to NULL. It raises only when jsonb_set wiped the column and we didn't expect it to, because I am not confident enough that this was the only jsonb_set bug.

This doesn't raise. `jsonb_set` wipes the column when you try to set the value to `NULL`, `safe_jsonb_set` has a `coalesce` which will call `jsonb_set` with `'null'::jsonb` if asked to set the value to `NULL`. It raises only when `jsonb_set` wiped the column and we didn't expect it to, because I am not confident enough that this was the only `jsonb_set` bug.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma!5235
No description provided.