diff --git a/core/block/editor/chatobject/chathandler.go b/core/block/editor/chatobject/chathandler.go index 83065279c..f2f2962fe 100644 --- a/core/block/editor/chatobject/chathandler.go +++ b/core/block/editor/chatobject/chathandler.go @@ -25,11 +25,11 @@ type ChatHandler struct { } func (d *ChatHandler) CollectionName() string { - return collectionName + return CollectionName } func (d *ChatHandler) Init(ctx context.Context, s *storestate.StoreState) (err error) { - coll, err := s.Collection(ctx, collectionName) + coll, err := s.Collection(ctx, CollectionName) if err != nil { return err } @@ -85,7 +85,7 @@ func (d *ChatHandler) BeforeModify(ctx context.Context, ch storestate.ChangeOp) } func (d *ChatHandler) BeforeDelete(ctx context.Context, ch storestate.ChangeOp) (mode storestate.DeleteMode, err error) { - coll, err := ch.State.Collection(ctx, collectionName) + coll, err := ch.State.Collection(ctx, CollectionName) if err != nil { return storestate.DeleteModeDelete, fmt.Errorf("get collection: %w", err) } diff --git a/core/block/editor/chatobject/chatobject.go b/core/block/editor/chatobject/chatobject.go index a44cd3c20..50027d816 100644 --- a/core/block/editor/chatobject/chatobject.go +++ b/core/block/editor/chatobject/chatobject.go @@ -26,7 +26,7 @@ import ( ) const ( - collectionName = "chats" + CollectionName = "chats" descOrder = "-_o.id" ascOrder = "_o.id" descStateId = "-stateId" @@ -109,7 +109,7 @@ func (s *storeObject) Init(ctx *smartblock.InitContext) error { return fmt.Errorf("source is not a store") } - collection, err := s.crdtDb.Collection(ctx.Ctx, storeSource.Id()+collectionName) + collection, err := s.crdtDb.Collection(ctx.Ctx, storeSource.Id()+CollectionName) if err != nil { return fmt.Errorf("get collection: %w", err) } @@ -226,7 +226,7 @@ func (s *storeObject) AddMessage(ctx context.Context, sessionCtx session.Context message.MarshalAnyenc(obj, arena) builder := storestate.Builder{} - err := builder.Create(collectionName, storestate.IdFromChange, obj) + err := builder.Create(CollectionName, storestate.IdFromChange, obj) if err != nil { return "", fmt.Errorf("create chat: %w", err) } @@ -245,7 +245,7 @@ func (s *storeObject) AddMessage(ctx context.Context, sessionCtx session.Context func (s *storeObject) DeleteMessage(ctx context.Context, messageId string) error { builder := storestate.Builder{} - builder.Delete(collectionName, messageId) + builder.Delete(CollectionName, messageId) _, err := s.storeSource.PushStoreChange(ctx, source.PushStoreChangeParams{ Changes: builder.ChangeSet, State: s.store, @@ -268,7 +268,7 @@ func (s *storeObject) EditMessage(ctx context.Context, messageId string, newMess newMessage.MarshalAnyenc(obj, arena) builder := storestate.Builder{} - err := builder.Modify(collectionName, messageId, []string{contentKey}, pb.ModifyOp_Set, obj.Get(contentKey)) + err := builder.Modify(CollectionName, messageId, []string{contentKey}, pb.ModifyOp_Set, obj.Get(contentKey)) if err != nil { return fmt.Errorf("modify content: %w", err) } @@ -298,12 +298,12 @@ func (s *storeObject) ToggleMessageReaction(ctx context.Context, messageId strin builder := storestate.Builder{} if hasReaction { - err = builder.Modify(collectionName, messageId, []string{reactionsKey, emoji}, pb.ModifyOp_Pull, arena.NewString(s.accountService.AccountID())) + err = builder.Modify(CollectionName, messageId, []string{reactionsKey, emoji}, pb.ModifyOp_Pull, arena.NewString(s.accountService.AccountID())) if err != nil { return fmt.Errorf("modify content: %w", err) } } else { - err = builder.Modify(collectionName, messageId, []string{reactionsKey, emoji}, pb.ModifyOp_AddToSet, arena.NewString(s.accountService.AccountID())) + err = builder.Modify(CollectionName, messageId, []string{reactionsKey, emoji}, pb.ModifyOp_AddToSet, arena.NewString(s.accountService.AccountID())) if err != nil { return fmt.Errorf("modify content: %w", err) } diff --git a/core/block/editor/storestate/state.go b/core/block/editor/storestate/state.go index fda07dbf9..d93c00d5d 100644 --- a/core/block/editor/storestate/state.go +++ b/core/block/editor/storestate/state.go @@ -29,7 +29,7 @@ const ( var LexId = lexid.Must(lexid.CharsAllNoEscape, 4, 100) const ( - collChangeOrders = "_change_orders" + CollChangeOrders = "_change_orders" ) func New(ctx context.Context, id string, db anystore.DB, handlers ...Handler) (state *StoreState, err error) { @@ -104,7 +104,7 @@ type StoreState struct { } func (ss *StoreState) init(ctx context.Context) (err error) { - if ss.collChangeOrders, err = ss.Collection(ctx, collChangeOrders); err != nil { + if ss.collChangeOrders, err = ss.Collection(ctx, CollChangeOrders); err != nil { return } for _, h := range ss.handlers { diff --git a/core/indexer/flags.go b/core/indexer/flags.go index af71f737f..5c4eb1c14 100644 --- a/core/indexer/flags.go +++ b/core/indexer/flags.go @@ -15,6 +15,7 @@ type reindexFlags struct { deletedObjects bool eraseLinks bool removeParticipants bool + chats bool } func (f *reindexFlags) any() bool { @@ -29,7 +30,8 @@ func (f *reindexFlags) any() bool { f.removeOldFiles || f.deletedObjects || f.removeParticipants || - f.eraseLinks + f.eraseLinks || + f.chats } func (f *reindexFlags) enableAll() { @@ -45,6 +47,7 @@ func (f *reindexFlags) enableAll() { f.deletedObjects = true f.removeParticipants = true f.eraseLinks = true + f.chats = true } func (f *reindexFlags) String() string { diff --git a/core/indexer/reindex.go b/core/indexer/reindex.go index a252ac4cc..6acb6a379 100644 --- a/core/indexer/reindex.go +++ b/core/indexer/reindex.go @@ -10,7 +10,9 @@ import ( "github.com/anyproto/any-sync/commonspace/headsync/headstorage" "go.uber.org/zap" + "github.com/anyproto/anytype-heart/core/block/editor/chatobject" "github.com/anyproto/anytype-heart/core/block/editor/smartblock" + "github.com/anyproto/anytype-heart/core/block/editor/storestate" "github.com/anyproto/anytype-heart/core/block/object/objectcache" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/core/syncstatus/detailsupdater/helper" @@ -49,6 +51,7 @@ const ( ForceReindexDeletedObjectsCounter int32 = 1 ForceReindexParticipantsCounter int32 = 1 + ForceReindexChatsCounter int32 = 1 ) type allDeletedIdsProvider interface { @@ -76,6 +79,7 @@ func (i *indexer) buildFlags(spaceID string) (reindexFlags, error) { AreOldFilesRemoved: true, ReindexDeletedObjects: 0, // Set to zero to force reindexing of deleted objects when objectstore was deleted ReindexParticipants: ForceReindexParticipantsCounter, + ReindexChats: ForceReindexChatsCounter, } } @@ -116,6 +120,9 @@ func (i *indexer) buildFlags(spaceID string) (reindexFlags, error) { if checksums.LinksErase != ForceLinksReindexCounter { flags.eraseLinks = true } + if checksums.ReindexChats != ForceReindexChatsCounter { + flags.chats = true + } if spaceID == addr.AnytypeMarketplaceWorkspace && checksums.MarketplaceForceReindexCounter != ForceMarketplaceReindex { flags.enableAll() } @@ -201,6 +208,13 @@ func (i *indexer) ReindexSpace(space clientspace.Space) (err error) { }() } + if flags.chats { + err = i.reindexChats(ctx, space) + if err != nil { + log.Error("reindex chats", zap.Error(err)) + } + } + if flags.deletedObjects { err = i.reindexDeletedObjects(space) if err != nil { @@ -220,6 +234,56 @@ func (i *indexer) ReindexSpace(space clientspace.Space) (err error) { return i.saveLatestChecksums(space.Id()) } +func (i *indexer) reindexChats(ctx context.Context, space clientspace.Space) error { + ids, err := i.getIdsForTypes(space, coresb.SmartBlockTypeChatDerivedObject) + if err != nil { + return err + } + if len(ids) == 0 { + return nil + } + db := i.store.GetCrdtDb(space.Id()) + + txn, err := db.WriteTx(ctx) + if err != nil { + return fmt.Errorf("write tx: %w", err) + } + defer txn.Rollback() + + for _, id := range ids { + col, err := db.OpenCollection(txn.Context(), id+chatobject.CollectionName) + if errors.Is(err, anystore.ErrCollectionNotFound) { + continue + } + if err != nil { + return fmt.Errorf("open collection: %w", err) + } + err = col.Drop(txn.Context()) + if err != nil { + return fmt.Errorf("drop chat collection: %w", err) + } + + col, err = db.OpenCollection(txn.Context(), id+storestate.CollChangeOrders) + if errors.Is(err, anystore.ErrCollectionNotFound) { + continue + } + if err != nil { + return fmt.Errorf("open orders collection: %w", err) + } + err = col.Drop(txn.Context()) + if err != nil { + return fmt.Errorf("drop chat orders collection: %w", err) + } + } + + err = txn.Commit() + if err != nil { + return fmt.Errorf("commit: %w", err) + } + + return nil +} + func (i *indexer) addSyncDetails(space clientspace.Space) { typesForSyncRelations := helper.SyncRelationsSmartblockTypes() syncStatus := domain.ObjectSyncStatusSynced @@ -511,6 +575,7 @@ func (i *indexer) getLatestChecksums(isMarketplace bool) (checksums model.Object LinksErase: ForceLinksReindexCounter, ReindexDeletedObjects: ForceReindexDeletedObjectsCounter, ReindexParticipants: ForceReindexParticipantsCounter, + ReindexChats: ForceReindexChatsCounter, } if isMarketplace { checksums.MarketplaceForceReindexCounter = ForceMarketplaceReindex diff --git a/docs/proto.md b/docs/proto.md index c7d64eaa7..d353bb54f 100644 --- a/docs/proto.md +++ b/docs/proto.md @@ -30029,6 +30029,7 @@ Precondition: user A and user B opened the same block | marketplaceForceReindexCounter | [int32](#int32) | | | | reindexDeletedObjects | [int32](#int32) | | | | reindexParticipants | [int32](#int32) | | | +| reindexChats | [int32](#int32) | | | diff --git a/pkg/lib/pb/model/localstore.pb.go b/pkg/lib/pb/model/localstore.pb.go index 645a6e53e..9314b541a 100644 --- a/pkg/lib/pb/model/localstore.pb.go +++ b/pkg/lib/pb/model/localstore.pb.go @@ -453,6 +453,7 @@ type ObjectStoreChecksums struct { MarketplaceForceReindexCounter int32 `protobuf:"varint,15,opt,name=marketplaceForceReindexCounter,proto3" json:"marketplaceForceReindexCounter,omitempty"` ReindexDeletedObjects int32 `protobuf:"varint,16,opt,name=reindexDeletedObjects,proto3" json:"reindexDeletedObjects,omitempty"` ReindexParticipants int32 `protobuf:"varint,17,opt,name=reindexParticipants,proto3" json:"reindexParticipants,omitempty"` + ReindexChats int32 `protobuf:"varint,18,opt,name=reindexChats,proto3" json:"reindexChats,omitempty"` } func (m *ObjectStoreChecksums) Reset() { *m = ObjectStoreChecksums{} } @@ -607,6 +608,13 @@ func (m *ObjectStoreChecksums) GetReindexParticipants() int32 { return 0 } +func (m *ObjectStoreChecksums) GetReindexChats() int32 { + if m != nil { + return m.ReindexChats + } + return 0 +} + func init() { proto.RegisterType((*ObjectInfo)(nil), "anytype.model.ObjectInfo") proto.RegisterType((*ObjectDetails)(nil), "anytype.model.ObjectDetails") @@ -623,55 +631,56 @@ func init() { } var fileDescriptor_9c35df71910469a5 = []byte{ - // 766 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0xad, 0x93, 0x26, 0x69, 0x6e, 0x48, 0x1f, 0x53, 0x10, 0x43, 0x41, 0x96, 0x15, 0x55, 0x28, - 0xaa, 0x20, 0x81, 0x3e, 0x36, 0x2c, 0x40, 0x6a, 0x4b, 0xa5, 0x42, 0xa5, 0x20, 0xb7, 0x08, 0x89, - 0x9d, 0x1d, 0x4f, 0xda, 0x21, 0x13, 0x8f, 0xe5, 0x19, 0xa3, 0x66, 0xc1, 0x92, 0x0d, 0x2b, 0x7e, - 0x80, 0xff, 0x61, 0xd9, 0x25, 0x4b, 0xd4, 0xfe, 0x01, 0xe2, 0x03, 0x90, 0x67, 0x9c, 0xd4, 0x71, - 0xdd, 0x14, 0x09, 0x96, 0x3e, 0xf7, 0x9c, 0xe3, 0x33, 0xf7, 0x7a, 0xae, 0xa1, 0x19, 0xf4, 0x8f, - 0xdb, 0x8c, 0xba, 0xed, 0xc0, 0x6d, 0x0f, 0xb8, 0x47, 0x58, 0x3b, 0x08, 0xb9, 0xe4, 0xa2, 0xcd, - 0x78, 0xd7, 0x61, 0x42, 0xf2, 0x90, 0xb4, 0x14, 0x82, 0xea, 0x8e, 0x3f, 0x94, 0xc3, 0x80, 0xb4, - 0x14, 0x6d, 0xe5, 0xc1, 0x31, 0xe7, 0xc7, 0x8c, 0x68, 0xba, 0x1b, 0xf5, 0xda, 0x42, 0x86, 0x51, - 0x57, 0x6a, 0xf2, 0xca, 0xea, 0x75, 0xb6, 0xea, 0x41, 0x68, 0x56, 0xe3, 0x97, 0x01, 0xd0, 0x71, - 0x3f, 0x90, 0xae, 0xdc, 0xf7, 0x7b, 0x1c, 0xcd, 0x43, 0x81, 0x7a, 0xd8, 0xb0, 0x8c, 0x66, 0xd5, - 0x2e, 0x50, 0x0f, 0x3d, 0x84, 0x79, 0xae, 0xaa, 0x47, 0xc3, 0x80, 0xbc, 0x0d, 0x99, 0xc0, 0x05, - 0xab, 0xd8, 0xac, 0xda, 0x19, 0x14, 0x3d, 0x85, 0x8a, 0x47, 0xa4, 0x43, 0x99, 0xc0, 0x45, 0xcb, - 0x68, 0xd6, 0xd6, 0xef, 0xb6, 0x74, 0xb8, 0xd6, 0x28, 0x5c, 0xeb, 0x50, 0x85, 0xb3, 0x47, 0x3c, - 0xb4, 0x05, 0xd5, 0x90, 0x30, 0x47, 0x52, 0xee, 0x0b, 0x3c, 0x6b, 0x15, 0x95, 0x68, 0xe2, 0x80, - 0x2d, 0x3b, 0xa9, 0xdb, 0x97, 0x4c, 0x84, 0xa1, 0x22, 0x7c, 0x1a, 0x04, 0x44, 0xe2, 0x92, 0x8a, - 0x39, 0x7a, 0x44, 0x4d, 0x58, 0x38, 0x71, 0xc4, 0xbe, 0xef, 0xf2, 0xc8, 0xf7, 0x0e, 0xa8, 0xdf, - 0x17, 0xb8, 0x6c, 0x19, 0xcd, 0x39, 0x3b, 0x0b, 0x37, 0xb6, 0xa1, 0xae, 0xcf, 0xbc, 0x9b, 0x64, - 0x49, 0xc5, 0x37, 0xfe, 0x2e, 0x7e, 0xa3, 0x03, 0x35, 0xed, 0xa1, 0x2c, 0x91, 0x09, 0x40, 0xf5, - 0x2b, 0xf6, 0x77, 0x63, 0x93, 0xb8, 0x49, 0x29, 0x04, 0x59, 0x50, 0xe3, 0x91, 0x1c, 0x13, 0x74, - 0x17, 0xd3, 0x50, 0xe3, 0x13, 0x2c, 0xa4, 0x0c, 0xd5, 0x34, 0x36, 0xa0, 0x92, 0x58, 0x28, 0xc7, - 0xda, 0xfa, 0xbd, 0x4c, 0x83, 0x2e, 0x27, 0x67, 0x8f, 0x98, 0x68, 0x0b, 0xe6, 0x46, 0xb6, 0xea, - 0x35, 0x53, 0x55, 0x63, 0x6a, 0xe3, 0x8b, 0x01, 0xcb, 0x97, 0x85, 0x77, 0x54, 0x9e, 0xe8, 0x83, - 0x65, 0xbf, 0x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, 0xd1, 0x8b, 0x18, 0x93, 0xe4, 0x54, - 0x26, 0x15, 0x5c, 0x51, 0xdc, 0x2c, 0x1c, 0x8f, 0x65, 0x04, 0xbd, 0x0c, 0x1d, 0x41, 0x70, 0x4d, - 0xf1, 0x26, 0xc1, 0x54, 0x37, 0x8f, 0xc8, 0x20, 0x60, 0x8e, 0x24, 0x02, 0xcf, 0x4d, 0x74, 0x73, - 0x8c, 0xa7, 0xba, 0xa9, 0xe7, 0x21, 0x70, 0x55, 0x59, 0x66, 0x50, 0xf4, 0x0a, 0x2c, 0x75, 0xda, - 0x78, 0xce, 0xaf, 0xc9, 0x30, 0xb7, 0x2b, 0xa0, 0x94, 0x37, 0xf2, 0xe2, 0xaf, 0xc3, 0x09, 0x49, - 0x87, 0x79, 0x7b, 0x31, 0xd3, 0x26, 0x03, 0xfe, 0x91, 0x78, 0xf8, 0x96, 0x5a, 0x96, 0x39, 0x95, - 0x78, 0x92, 0x4e, 0x48, 0x76, 0x09, 0x23, 0x72, 0x1c, 0x28, 0xb1, 0x24, 0x1e, 0xae, 0x2b, 0xdd, - 0x14, 0x46, 0xbc, 0x1c, 0xd5, 0xbd, 0xd6, 0x2d, 0x9b, 0x57, 0x29, 0x53, 0x08, 0xda, 0x03, 0x73, - 0xe0, 0x84, 0x7d, 0x22, 0x03, 0xe6, 0x74, 0x49, 0xde, 0xc9, 0x16, 0x94, 0xe6, 0x06, 0x16, 0xda, - 0x84, 0x3b, 0xa1, 0x46, 0x26, 0x93, 0xe0, 0x45, 0x25, 0xcf, 0x2f, 0xa2, 0x27, 0xb0, 0x9c, 0x14, - 0xde, 0x38, 0xa1, 0xa4, 0x5d, 0x1a, 0x38, 0xbe, 0x14, 0x78, 0x49, 0x69, 0xf2, 0x4a, 0xdb, 0x6b, - 0xdf, 0xcf, 0x4d, 0xe3, 0xec, 0xdc, 0x34, 0x7e, 0x9e, 0x9b, 0xc6, 0xd7, 0x0b, 0x73, 0xe6, 0xec, - 0xc2, 0x9c, 0xf9, 0x71, 0x61, 0xce, 0xbc, 0x5f, 0xcc, 0xfe, 0x74, 0xdd, 0xb2, 0xfa, 0x83, 0x6c, - 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x63, 0x84, 0x4f, 0x64, 0xe6, 0x07, 0x00, 0x00, + // 783 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x4f, 0xdb, 0x48, + 0x14, 0xc6, 0x09, 0x21, 0xe4, 0x85, 0xf0, 0x63, 0xd8, 0xd5, 0xce, 0xb2, 0x2b, 0xcb, 0xb2, 0xd0, + 0x2a, 0x42, 0xbb, 0xc9, 0x96, 0x1f, 0x97, 0x1e, 0x5a, 0x09, 0x28, 0x12, 0x2d, 0x52, 0x2a, 0x43, + 0x55, 0xa9, 0x37, 0x3b, 0x9e, 0x90, 0x69, 0x26, 0x1e, 0xcb, 0x33, 0xae, 0xc8, 0xa1, 0xc7, 0x5e, + 0x7a, 0xea, 0xb1, 0x97, 0xfe, 0x3f, 0x3d, 0x72, 0xec, 0xb1, 0x82, 0xff, 0xa0, 0x7f, 0x41, 0xe5, + 0x19, 0x27, 0x38, 0xc6, 0x84, 0x4a, 0xed, 0xd1, 0xdf, 0xfb, 0xbe, 0xcf, 0xdf, 0xbc, 0xe7, 0x79, + 0x86, 0x66, 0x38, 0x38, 0x6f, 0x33, 0xea, 0xb5, 0x43, 0xaf, 0x3d, 0xe4, 0x3e, 0x61, 0xed, 0x30, + 0xe2, 0x92, 0x8b, 0x36, 0xe3, 0x5d, 0x97, 0x09, 0xc9, 0x23, 0xd2, 0x52, 0x08, 0x6a, 0xb8, 0xc1, + 0x48, 0x8e, 0x42, 0xd2, 0x52, 0xb4, 0x8d, 0xbf, 0xcf, 0x39, 0x3f, 0x67, 0x44, 0xd3, 0xbd, 0xb8, + 0xd7, 0x16, 0x32, 0x8a, 0xbb, 0x52, 0x93, 0x37, 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8f, 0x03, 0x49, 0x22, 0x3c, 0x6f, 0x19, 0xcd, 0x8a, 0x33, 0x83, 0x81, + 0x1e, 0x02, 0xee, 0x51, 0x46, 0x0a, 0xd5, 0x15, 0xa5, 0xbe, 0xb3, 0x8e, 0xfe, 0x85, 0x35, 0xea, + 0x5f, 0x38, 0xc4, 0x8b, 0x29, 0xf3, 0xc7, 0xa2, 0x05, 0x25, 0xba, 0x5d, 0x48, 0x36, 0x47, 0x2f, + 0x66, 0x4c, 0x92, 0x0b, 0x99, 0x56, 0x70, 0x55, 0x71, 0xf3, 0x70, 0x32, 0x96, 0x31, 0xf4, 0x24, + 0x72, 0x05, 0xc1, 0x75, 0xc5, 0x9b, 0x06, 0x33, 0xdd, 0x3c, 0x23, 0xc3, 0x90, 0xb9, 0x92, 0x08, + 0xbc, 0x38, 0xd5, 0xcd, 0x09, 0x9e, 0xe9, 0xa6, 0x9e, 0x87, 0xc0, 0x35, 0x65, 0x99, 0x43, 0xd1, + 0x53, 0xb0, 0xd4, 0x69, 0x93, 0x39, 0x3f, 0x23, 0xa3, 0xc2, 0xae, 0x80, 0x52, 0xde, 0xcb, 0x4b, + 0xbe, 0x0e, 0x37, 0x22, 0x1d, 0xe6, 0x1f, 0x25, 0x4c, 0x87, 0x0c, 0xf9, 0x1b, 0xe2, 0xe3, 0x25, + 0xb5, 0x2c, 0x0b, 0x2a, 0xc9, 0x24, 0xdd, 0x88, 0x1c, 0x12, 0x46, 0xe4, 0x24, 0x50, 0x6a, 0x49, + 0x7c, 0xdc, 0x50, 0xba, 0x19, 0x8c, 0x64, 0x39, 0xaa, 0x7b, 0xad, 0x5b, 0xb6, 0xac, 0x52, 0x66, + 0x10, 0x74, 0x04, 0xe6, 0xd0, 0x8d, 0x06, 0x44, 0x86, 0xcc, 0xed, 0x92, 0xa2, 0x93, 0xad, 0x28, + 0xcd, 0x3d, 0x2c, 0xb4, 0x0b, 0xbf, 0x47, 0x1a, 0x99, 0x4e, 0x82, 0x57, 0x95, 0xbc, 0xb8, 0x88, + 0xfe, 0x87, 0xf5, 0xb4, 0xf0, 0xdc, 0x8d, 0x24, 0xed, 0xd2, 0xd0, 0x0d, 0xa4, 0xc0, 0x6b, 0x4a, + 0x53, 0x54, 0x42, 0x36, 0x2c, 0xa5, 0xf0, 0x41, 0xdf, 0x95, 0x02, 0x23, 0x45, 0x9d, 0xc2, 0xf6, + 0xb7, 0x3e, 0x5f, 0x99, 0xc6, 0xe5, 0x95, 0x69, 0x7c, 0xbd, 0x32, 0x8d, 0x0f, 0xd7, 0xe6, 0xdc, + 0xe5, 0xb5, 0x39, 0xf7, 0xe5, 0xda, 0x9c, 0x7b, 0xb5, 0x9a, 0xff, 0x31, 0x7b, 0x0b, 0xea, 0x2f, + 0xb3, 0xf3, 0x3d, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xb3, 0x53, 0xec, 0x0a, 0x08, 0x00, 0x00, } func (m *ObjectInfo) Marshal() (dAtA []byte, err error) { @@ -1064,6 +1073,13 @@ func (m *ObjectStoreChecksums) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ReindexChats != 0 { + i = encodeVarintLocalstore(dAtA, i, uint64(m.ReindexChats)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } if m.ReindexParticipants != 0 { i = encodeVarintLocalstore(dAtA, i, uint64(m.ReindexParticipants)) i-- @@ -1404,6 +1420,9 @@ func (m *ObjectStoreChecksums) Size() (n int) { if m.ReindexParticipants != 0 { n += 2 + sovLocalstore(uint64(m.ReindexParticipants)) } + if m.ReindexChats != 0 { + n += 2 + sovLocalstore(uint64(m.ReindexChats)) + } return n } @@ -2829,6 +2848,25 @@ func (m *ObjectStoreChecksums) Unmarshal(dAtA []byte) error { break } } + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReindexChats", wireType) + } + m.ReindexChats = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLocalstore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReindexChats |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipLocalstore(dAtA[iNdEx:]) diff --git a/pkg/lib/pb/model/protos/localstore.proto b/pkg/lib/pb/model/protos/localstore.proto index 3e2193103..faa4106e9 100644 --- a/pkg/lib/pb/model/protos/localstore.proto +++ b/pkg/lib/pb/model/protos/localstore.proto @@ -65,4 +65,5 @@ message ObjectStoreChecksums { int32 marketplaceForceReindexCounter = 15; int32 reindexDeletedObjects = 16; int32 reindexParticipants = 17; + int32 reindexChats = 18; }