Closed reinkrul closed 3 years ago
Merging #159 (6b52c14) into master (38b7520) will decrease coverage by
0.34%
. The diff coverage is81.25%
.
Impacted Files | Coverage Δ | |
---|---|---|
pkg/network/ambassador.go | 61.76% <0.00%> (-4.91%) |
:arrow_down: |
pkg/events/events.go | 83.18% <100.00%> (+1.11%) |
:arrow_up: |
pkg/events/system.go | 82.90% <100.00%> (-4.60%) |
:arrow_down: |
Registry v0 events don't have the
issuedAt
field. When loading from disk this is solved by taking the timestamp from the filename as event timestamp (issuedAt
), but this doesn't work when events are received over Nuts Network. In that caseissuedAt
stays0
which causes sorting problems when events are received out-of-order because they're sorted onissuedAt
. This in turn can lead to a nil pointer dereference because a previous event (prev
field) might not have been processed although it should have, because sorting the events made sure previous events are processed first.This can be fixed quite easily by using the document timestamp as event
issuedAt
, because document timestamp is filled usingissuedAt
on the sending side.Fixes #163