Skip to content

Commit

Permalink
fix: cleanup revision requests
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko committed Dec 29, 2023
1 parent c1805ee commit 7e8d7f6
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 186 deletions.
71 changes: 0 additions & 71 deletions packages/auth/bin/revisions_cleanup.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/auth/docker/entrypoint-revisions-cleanup.js

This file was deleted.

4 changes: 0 additions & 4 deletions packages/auth/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ case "$COMMAND" in
exec node docker/entrypoint-delete-accounts.js $FILE_NAME $MODE
;;

'revisions-cleanup' )
exec node docker/entrypoint-revisions-cleanup.js
;;

* )
echo "[Docker] Unknown command"
;;
Expand Down
17 changes: 0 additions & 17 deletions packages/auth/src/Domain/Event/DomainEventFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
SessionRefreshedEvent,
AccountDeletionVerificationRequestedEvent,
FileQuotaRecalculationRequestedEvent,
RevisionsCleanupRequestedEvent,
} from '@standardnotes/domain-events'
import { Predicate, PredicateVerificationResult } from '@standardnotes/predicates'
import { TimerInterface } from '@standardnotes/time'
Expand All @@ -35,22 +34,6 @@ import { KeyParamsData } from '@standardnotes/responses'
@injectable()
export class DomainEventFactory implements DomainEventFactoryInterface {
constructor(@inject(TYPES.Auth_Timer) private timer: TimerInterface) {}

createRevisionsCleanupRequestedEvent(dto: { userUuid: string }): RevisionsCleanupRequestedEvent {
return {
type: 'REVISIONS_CLEANUP_REQUESTED',
createdAt: this.timer.getUTCDate(),
meta: {
correlation: {
userIdentifier: dto.userUuid,
userIdentifierType: 'uuid',
},
origin: DomainEventService.Auth,
},
payload: dto,
}
}

createFileQuotaRecalculationRequestedEvent(dto: { userUuid: string }): FileQuotaRecalculationRequestedEvent {
return {
type: 'FILE_QUOTA_RECALCULATION_REQUESTED',
Expand Down
2 changes: 0 additions & 2 deletions packages/auth/src/Domain/Event/DomainEventFactoryInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ import {
SessionRefreshedEvent,
AccountDeletionVerificationRequestedEvent,
FileQuotaRecalculationRequestedEvent,
RevisionsCleanupRequestedEvent,
} from '@standardnotes/domain-events'
import { InviteeIdentifierType } from '../SharedSubscription/InviteeIdentifierType'
import { KeyParamsData } from '@standardnotes/responses'

export interface DomainEventFactoryInterface {
createRevisionsCleanupRequestedEvent(dto: { userUuid: string }): RevisionsCleanupRequestedEvent
createFileQuotaRecalculationRequestedEvent(dto: { userUuid: string }): FileQuotaRecalculationRequestedEvent
createWebSocketMessageRequestedEvent(dto: { userUuid: string; message: JSONString }): WebSocketMessageRequestedEvent
createEmailRequestedEvent(dto: {
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/domain-events/src/Domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ export * from './Event/PredicateVerifiedEvent'
export * from './Event/PredicateVerifiedEventPayload'
export * from './Event/RefundProcessedEvent'
export * from './Event/RefundProcessedEventPayload'
export * from './Event/RevisionsCleanupRequestedEvent'
export * from './Event/RevisionsCleanupRequestedEventPayload'
export * from './Event/RevisionsCopyRequestedEvent'
export * from './Event/RevisionsCopyRequestedEventPayload'
export * from './Event/SessionCreatedEvent'
Expand Down
12 changes: 0 additions & 12 deletions packages/syncing-server/src/Bootstrap/Container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ import { SyncResponse } from '@standardnotes/grpc'
import { SyncResponseGRPCMapper } from '../Mapping/gRPC/SyncResponseGRPCMapper'
import { AccountDeletionVerificationRequestedEventHandler } from '../Domain/Handler/AccountDeletionVerificationRequestedEventHandler'
import { SendEventToClients } from '../Domain/UseCase/Syncing/SendEventToClients/SendEventToClients'
import { RevisionsCleanupRequestedEventHandler } from '../Domain/Handler/RevisionsCleanupRequestedEventHandler'

export class ContainerConfigLoader {
private readonly DEFAULT_CONTENT_SIZE_TRANSFER_LIMIT = 10_000_000
Expand Down Expand Up @@ -981,16 +980,6 @@ export class ContainerConfigLoader {
container.get<Logger>(TYPES.Sync_Logger),
),
)
container
.bind<RevisionsCleanupRequestedEventHandler>(TYPES.Sync_RevisionsCleanupRequestedEventHandler)
.toConstantValue(
new RevisionsCleanupRequestedEventHandler(
container.get<ItemRepositoryInterface>(TYPES.Sync_SQLItemRepository),
container.get<DomainEventFactoryInterface>(TYPES.Sync_DomainEventFactory),
container.get<DomainEventPublisherInterface>(TYPES.Sync_DomainEventPublisher),
container.get<Logger>(TYPES.Sync_Logger),
),
)

// Services
container.bind<ContentDecoderInterface>(TYPES.Sync_ContentDecoder).toDynamicValue(() => new ContentDecoder())
Expand Down Expand Up @@ -1019,7 +1008,6 @@ export class ContainerConfigLoader {
'SHARED_VAULT_REMOVED',
container.get<SharedVaultRemovedEventHandler>(TYPES.Sync_SharedVaultRemovedEventHandler),
],
['REVISIONS_CLEANUP_REQUESTED', container.get(TYPES.Sync_RevisionsCleanupRequestedEventHandler)],
])
if (!isConfiguredForHomeServer) {
container
Expand Down
1 change: 0 additions & 1 deletion packages/syncing-server/src/Bootstrap/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const TYPES = {
Sync_SharedVaultFileUploadedEventHandler: Symbol.for('Sync_SharedVaultFileUploadedEventHandler'),
Sync_SharedVaultFileMovedEventHandler: Symbol.for('Sync_SharedVaultFileMovedEventHandler'),
Sync_SharedVaultRemovedEventHandler: Symbol.for('Sync_SharedVaultRemovedEventHandler'),
Sync_RevisionsCleanupRequestedEventHandler: Symbol.for('Sync_RevisionsCleanupRequestedEventHandler'),
// Services
Sync_ContentDecoder: Symbol.for('Sync_ContentDecoder'),
Sync_DomainEventPublisher: Symbol.for('Sync_DomainEventPublisher'),
Expand Down

This file was deleted.

0 comments on commit 7e8d7f6

Please sign in to comment.