Skip to content

Commit

Permalink
fix bug in HCLRevisionFromString when parsing zero logical clock
Browse files Browse the repository at this point in the history
  • Loading branch information
vroldanbet committed Nov 6, 2024
1 parent ec5dfd9 commit 9f926f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/datastore/revisions/hlcrevision.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func parseHLCRevisionString(revisionStr string) (datastore.Revision, error) {
if err != nil {
return datastore.NoRevision, spiceerrors.MustBugf("could not cast logicalclock to uint32: %v", err)
}
if uintLogicalClock == 0 {
return HLCRevision{timestamp, 0}, nil
}

return HLCRevision{timestamp, uintLogicalClock + logicalClockOffset}, nil
}

Expand Down

0 comments on commit 9f926f7

Please sign in to comment.