mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-08 22:55:07 +02:00
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:
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user