Skip to content

Commit

Permalink
Specify omitempty for some fields in DeviceListUpdateEvent
Browse files Browse the repository at this point in the history
This should address the cause of matrix-org/synapse#12829. These fields are optional, so we should omit them if they are empty instead of sending `null`.
  • Loading branch information
neilalexander committed May 23, 2022
1 parent eee8fd5 commit fc436f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions device_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import "encoding/json"
type DeviceListUpdateEvent struct {
UserID string `json:"user_id"`
DeviceID string `json:"device_id"`
DeviceDisplayName string `json:"device_display_name"`
DeviceDisplayName string `json:"device_display_name,omitempty"`
StreamID int64 `json:"stream_id"`
PrevID []int64 `json:"prev_id"`
Deleted bool `json:"deleted"`
Keys json.RawMessage `json:"keys"`
PrevID []int64 `json:"prev_id,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Keys json.RawMessage `json:"keys,omitempty"`
}

0 comments on commit fc436f4

Please sign in to comment.