Skip to content

Commit

Permalink
Merge pull request #1524 from anyproto/go-3849-fix-gc-on-set-source
Browse files Browse the repository at this point in the history
GO-3849 Do not GC set if source is set
  • Loading branch information
KirillSto authored Aug 31, 2024
2 parents a737e41 + 2a33dc6 commit 5fb0c26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/block/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,13 @@ func (s *Service) SetSource(ctx session.Context, req pb.RpcObjectSetSourceReques
return true
})
st.SetDetailAndBundledRelation(bundle.RelationKeySetOf, pbtypes.StringList(req.Source))
return sb.Apply(st, smartblock.NoRestrictions)

flags := internalflag.NewFromState(st)
// set with source is no longer empty
flags.Remove(model.InternalFlag_editorDeleteEmpty)
flags.AddToState(st)

return sb.Apply(st, smartblock.NoRestrictions, smartblock.KeepInternalFlags)
})
}

Expand Down

0 comments on commit 5fb0c26

Please sign in to comment.