In this PR, I'm solving several issues: 1) We were not checking if the currentWorkspaceMember was owning the message in the thread. It kind of worked before because the case of shared threads (with shared threads visibility restriction) was not happening that often. It seems that the bug has always been there 2) Re-implement orphan messages and threads deletion on messageChannel deletion. We used to brutally look for all orphans, we disabled it last week because it was too heavy on db. I've re-implemented it more carefully and "surgically" 3) Gmail sync was not handling folder synced correctly. It was leveraging labelIds which it shouldn't do (this is a AND AND parameter) in full sync 4) Added a command to clean orphan message threads manually if needed. Usually this is done when you remove a messageChannel, or change blocklist rules but it can be useful to have it to debug
27 lines
1.4 KiB
TypeScript
27 lines
1.4 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
|
|
import { AppModule } from 'src/app.module';
|
|
import { DatabaseCommandModule } from 'src/database/commands/database-command.module';
|
|
import { FieldMetadataModule } from 'src/engine/metadata-modules/field-metadata/field-metadata.module';
|
|
import { ObjectMetadataModule } from 'src/engine/metadata-modules/object-metadata/object-metadata.module';
|
|
import { WorkspaceCleanerModule } from 'src/engine/workspace-manager/workspace-cleaner/workspace-cleaner.module';
|
|
import { WorkspaceHealthCommandModule } from 'src/engine/workspace-manager/workspace-health/commands/workspace-health-command.module';
|
|
import { WorkspaceMigrationRunnerCommandsModule } from 'src/engine/workspace-manager/workspace-migration-runner/commands/workspace-migration-runner-commands.module';
|
|
import { WorkspaceSyncMetadataCommandsModule } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/workspace-sync-metadata-commands.module';
|
|
import { MessagingMessageCleanerModule } from 'src/modules/messaging/message-cleaner/messaging-message-cleaner.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
AppModule,
|
|
WorkspaceSyncMetadataCommandsModule,
|
|
DatabaseCommandModule,
|
|
WorkspaceCleanerModule,
|
|
WorkspaceHealthCommandModule,
|
|
MessagingMessageCleanerModule,
|
|
WorkspaceMigrationRunnerCommandsModule,
|
|
ObjectMetadataModule,
|
|
FieldMetadataModule,
|
|
],
|
|
})
|
|
export class CommandModule {}
|