Skip to content

Commit

Permalink
Remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
PooyaRaki committed Jan 16, 2025
1 parent 1e51f9e commit c2c24fb
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 57 deletions.
13 changes: 0 additions & 13 deletions migrations/1733761866546-cleanNotificationData.ts

This file was deleted.

13 changes: 0 additions & 13 deletions migrations/1734992798452-cleanNotificationData.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/domain/hooks/helpers/event-notifications.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,18 @@ export class EventNotificationsHelper {
* @param event - {@link Event} to notify about
*/
public async onEventEnqueueNotifications(event: Event): Promise<unknown> {
console.log('NotificationToEnqueue:', JSON.stringify(event));
if (!this.isEventToNotify(event)) {
return;
}

const subscriptions = await this.getRelevantSubscribers(event);

console.log('NotificationSubscriptions:', JSON.stringify(subscriptions));

return await Promise.allSettled(
subscriptions.map(async (subscription) => {
const data = await this.mapEventNotification(
event,
subscription.subscriber,
);
console.log('NotificationData:', JSON.stringify(data));

if (!data) {
return;
Expand Down
5 changes: 0 additions & 5 deletions src/domain/hooks/hooks.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ export class HooksRepositoryWithNotifications
}

async onEvent(event: Event): Promise<unknown> {
console.log(
'Incoming Event:',
JSON.stringify(event),
'-----------------------------',
);
const isSupportedChainId = await this.eventCacheHelper.isSupportedChainMemo(
event.chainId,
);
Expand Down
21 changes: 0 additions & 21 deletions src/routes/notifications/v1/notifications.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export class NotificationsController {
return await this.notificationsService.registerDevice(registerDeviceDto);
}

console.log('PushNotificationRequest:', JSON.stringify(registerDeviceDto));

if (registerDeviceDto.timestamp) {
this.validateTimestamp(parseInt(registerDeviceDto.timestamp));
}
Expand All @@ -77,8 +75,6 @@ export class NotificationsController {
const compatibleV2Requests =
await this.createV2RegisterDto(registerDeviceDto);

console.log('CompatibleV2Requests:', JSON.stringify(compatibleV2Requests));

const v2Requests = [];

const deleteAllDeviceOwners =
Expand All @@ -88,7 +84,6 @@ export class NotificationsController {
// Some clients, such as the mobile app, do not call the delete endpoint to remove an owner key.
// Instead, they resend the updated list of owners without the key they want to delete.
// In such cases, we need to clear all the previous owners to ensure the update is applied correctly.
console.log('deleteDeviceOwnersFor:', registerDeviceDto.uuid);
await this.notificationServiceV2.deleteDeviceOwners(
registerDeviceDto.uuid,
);
Expand All @@ -112,10 +107,6 @@ export class NotificationsController {
if (registerDeviceDto.uuid) {
const unregistrationRequests = [];
for (const safeRegistration of registerDeviceDto.safeRegistrations) {
console.log(
'TokensToRemoveFromTheOldTxService:',
JSON.stringify(registerDeviceDto.uuid),
);
unregistrationRequests.push(
this.notificationsService.unregisterDevice({
chainId: safeRegistration.chainId,
Expand All @@ -132,11 +123,6 @@ export class NotificationsController {
'code' in result.reason &&
result.reason.code !== 404
) {
console.log(
'ErrorOccuredUnregisteringTheDecive:',
result.reason,
result.reason.code,
);
this.loggingService.error(result.reason);
}
}
Expand Down Expand Up @@ -276,7 +262,6 @@ export class NotificationsController {
@Param('chainId') chainId: string,
@Param('uuid', new ValidationPipe(UuidSchema)) uuid: UUID,
): Promise<void> {
console.log('ControllerUnregisterDevice:', chainId, uuid);
if (this.isPushNotificationV2Enabled) {
return await this.unregisterDeviceV2Compatible(chainId, uuid);
}
Expand All @@ -291,9 +276,7 @@ export class NotificationsController {
try {
await this.notificationServiceV2.deleteDevice(uuid);
} catch (error: unknown) {
console.log('NotificationUnregisterErrorNotFound:', error);
if (error instanceof NotFoundException) {
console.log('NotificationUnregisterErrorNotFound:', error);
// Do not throw a NotFound error when attempting to remove the token from the CGW,
// This ensures the TX service remove method is called
} else {
Expand All @@ -302,10 +285,8 @@ export class NotificationsController {
}

try {
console.log('here-----');
await this.notificationsService.unregisterDevice({ chainId, uuid });
} catch (error: unknown) {
console.log('NotificationUnregisterErrorTX---:', error);
// The token might already have been removed from the TX service.
// If this happens, the TX service will throw a 404 error, but it is safe to ignore it.
const errorObject = error as { code?: number };
Expand All @@ -322,7 +303,6 @@ export class NotificationsController {
@Param('safeAddress', new ValidationPipe(AddressSchema))
safeAddress: `0x${string}`,
): Promise<void> {
console.log('ControllerUnregisterSafe:', chainId, uuid, safeAddress);
if (this.isPushNotificationV2Enabled) {
return this.unregisterSafeV2Compatible(chainId, uuid, safeAddress);
}
Expand Down Expand Up @@ -362,7 +342,6 @@ export class NotificationsController {
safeAddress,
});
} catch (error: unknown) {
console.log('NotificationUnregisterError:', error);
// The token might already have been removed from the TX service.
// If this happens, the TX service will throw a 404 error, but it is safe to ignore it.
const errorObject = error as { code?: number };
Expand Down
1 change: 0 additions & 1 deletion src/routes/notifications/v1/notifications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class NotificationsService {
chainId: string;
uuid: string;
}): Promise<void> {
console.log('UnregisterDevice:', args.uuid, args.chainId);
return this.notificationsRepository.unregisterDevice(args);
}

Expand Down

0 comments on commit c2c24fb

Please sign in to comment.