Skip to content
Snippets Groups Projects

Fix `null` handling of publication state in changeset_specs

Merged Administrator requested to merge es/fix-changeset-spec-read into main

Created by: eseliger

This didn't fully work, it kinda by accident worked with new data, but it doesn't work with existing, migrated data (which is actually in the correct shape).

The problem: We marshalled anything to json, regardless if the value was unset (nil). That writes 'null' to the column (the string value null). Then, when we scan the changeset spec, that happily passes as 'null' is a valid json string, it unmarshals into nil, just as desired. This isn't very clean though. However: Existing values have been written as NULL (the literal) in the migration. Those are []byte{} and cannot be interpreted as json. This PR fixes marshalling null as proper NULL literals and also fixes unmarshalling. Next release we can run a quick migration to consolidate the state again.

Test plan

Verified the observed error disappeared.

Merge request reports

Approval is optional

Merged by avatar (Jul 8, 2025 1:36am UTC)

Merge details

  • Changes merged into main with d6239b9f.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading