62 lines
1.7 KiB
Diff
62 lines
1.7 KiB
Diff
diff --git a/events/dbpersist/dbpersist.go b/events/dbpersist/dbpersist.go
|
|
index 04e9fb87..5e47218e 100644
|
|
--- a/events/dbpersist/dbpersist.go
|
|
+++ b/events/dbpersist/dbpersist.go
|
|
@@ -306,6 +306,12 @@ func (p *DbPersistence) RecordFromRepoCommit(ctx context.Context, evt *comatprot
|
|
return nil, err
|
|
}
|
|
|
|
+ // Normalize empty string to nil for since field
|
|
+ var since *string
|
|
+ if evt.Since != nil && *evt.Since != "" {
|
|
+ since = evt.Since
|
|
+ }
|
|
+
|
|
rer := RepoEventRecord{
|
|
Commit: &models.DbCID{CID: cid.Cid(evt.Commit)},
|
|
//Prev
|
|
@@ -315,7 +321,7 @@ func (p *DbPersistence) RecordFromRepoCommit(ctx context.Context, evt *comatprot
|
|
Time: t,
|
|
Rebase: evt.Rebase,
|
|
Rev: evt.Rev,
|
|
- Since: evt.Since,
|
|
+ Since: since,
|
|
}
|
|
|
|
opsb, err := json.Marshal(evt.Ops)
|
|
@@ -339,6 +345,12 @@ func (p *DbPersistence) RecordFromRepoSync(ctx context.Context, evt *comatproto.
|
|
return nil, err
|
|
}
|
|
|
|
+ // Normalize empty string to nil for since field
|
|
+ var since *string
|
|
+ if evt.Since != nil && *evt.Since != "" {
|
|
+ since = evt.Since
|
|
+ }
|
|
+
|
|
rer := RepoEventRecord{
|
|
Repo: uid,
|
|
Type: "repo_sync",
|
|
@@ -555,6 +567,12 @@ func (p *DbPersistence) hydrateCommit(ctx context.Context, rer *RepoEventRecord)
|
|
return nil, err
|
|
}
|
|
|
|
+ // Normalize empty string to nil for since field
|
|
+ var since *string
|
|
+ if rer.Since != nil && *rer.Since != "" {
|
|
+ since = rer.Since
|
|
+ }
|
|
+
|
|
out := &comatproto.SyncSubscribeRepos_Commit{
|
|
Seq: int64(rer.Seq),
|
|
Repo: did,
|
|
@@ -564,7 +582,7 @@ func (p *DbPersistence) hydrateCommit(ctx context.Context, rer *RepoEventRecord)
|
|
Rebase: rer.Rebase,
|
|
Ops: ops,
|
|
Rev: rer.Rev,
|
|
- Since: rer.Since,
|
|
+ Since: since,
|
|
}
|
|
|
|
cs, err := p.readCarSlice(ctx, rer)
|