Add initial code to support unique per-entry IDs

This code has two caveats for old entries:
1. the ID is being backfiled with a random per-(device,entry) ID. So the ID won't match cross-device.
2. the server-side ID will still be a random ID that is unrelated to the entry ID
This commit is contained in:
David Dworken
2023-09-22 13:16:24 -07:00
parent 2a5a6d65c4
commit a5f11af150
6 changed files with 22 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/ddworken/hishtory/client/data"
"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
)
const (
@ -326,6 +327,7 @@ func MakeFakeHistoryEntry(command string) data.HistoryEntry {
StartTime: time.Unix(fakeHistoryTimestamp, 0).UTC(),
EndTime: time.Unix(fakeHistoryTimestamp+3, 0).UTC(),
DeviceId: "fake_device_id",
EntryId: uuid.Must(uuid.NewRandom()).String(),
}
}