Skip to content

Commit

Permalink
ensure 'blocks' field is set in tooBig events (#410)
Browse files Browse the repository at this point in the history
The `blocks` field is required to be present in order to pass validation
in the typescript code.
  • Loading branch information
whyrusleeping authored Nov 2, 2023
2 parents 227cab3 + d964a51 commit 6183dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions events/dbpersist.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ func (p *DbPersistence) hydrateCommit(ctx context.Context, rer *RepoEventRecord)

if len(cs) > carstore.MaxSliceLength {
out.TooBig = true
out.Blocks = []byte{}
} else {
out.Blocks = cs
}
Expand Down
2 changes: 1 addition & 1 deletion indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (ix *Indexer) HandleRepoEvent(ctx context.Context, evt *repomgr.RepoEvent)
toobig := false
slice := evt.RepoSlice
if len(slice) > MaxEventSliceLength || len(outops) > MaxOpsSliceLength {
slice = nil
slice = []byte{}
outops = nil
toobig = true
}
Expand Down

0 comments on commit 6183dd0

Please sign in to comment.