From 45b04351d8d02e53b3401b0ee23f7cbe750b63cd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 3 May 2021 11:45:15 +0200 Subject: bug: have a type for combined ids, fix https://github.com/MichaelMure/git-bug/issues/653 --- entities/bug/op_create.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'entities/bug/op_create.go') diff --git a/entities/bug/op_create.go b/entities/bug/op_create.go index fdfa131b..2afea406 100644 --- a/entities/bug/op_create.go +++ b/entities/bug/op_create.go @@ -32,7 +32,9 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) { return } - snapshot.id = op.Id() + // the Id of the Bug/Snapshot is the Id of the first Operation: CreateOperation + opId := op.Id() + snapshot.id = opId snapshot.addActor(op.Author()) snapshot.addParticipant(op.Author()) @@ -40,10 +42,11 @@ func (op *CreateOperation) Apply(snapshot *Snapshot) { snapshot.Title = op.Title comment := Comment{ - id: entity.CombineIds(snapshot.Id(), op.Id()), - Message: op.Message, - Author: op.Author(), - UnixTime: timestamp.Timestamp(op.UnixTime), + combinedId: entity.CombineIds(snapshot.id, opId), + targetId: opId, + Message: op.Message, + Author: op.Author(), + unixTime: timestamp.Timestamp(op.UnixTime), } snapshot.Comments = []Comment{comment} -- cgit