File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export const SyncError = {
186
186
} ,
187
187
NoSyncToken : {
188
188
description : "No syncToken" ,
189
- status : Status . NO_CONTENT ,
189
+ status : Status . INTERNAL_SERVER ,
190
190
isOperational : true ,
191
191
} ,
192
192
NoEventChanges : {
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ import { Request } from "express";
2
2
import { Status } from "@core/errors/status.codes" ;
3
3
import { Logger } from "@core/logger/winston.logger" ;
4
4
import { Payload_Sync_Notif } from "@core/types/sync.types" ;
5
- import { UserError } from "@backend/common/constants/error.constants" ;
5
+ import {
6
+ SyncError ,
7
+ UserError ,
8
+ } from "@backend/common/constants/error.constants" ;
6
9
import {
7
10
isFullSyncRequired ,
8
11
isInvalidGoogleToken ,
@@ -61,6 +64,18 @@ class SyncController {
61
64
res . status ( Status . OK ) . send ( result ) ;
62
65
return ;
63
66
}
67
+ if (
68
+ e instanceof Error &&
69
+ e . message === SyncError . NoSyncToken . description
70
+ ) {
71
+ logger . debug (
72
+ `Ignored notification due to missing sync token for resourceId: ${ resourceId } ` ,
73
+ ) ;
74
+ // returning 204 instead of 500 so client doesn't
75
+ // attempt to retry
76
+ res . status ( Status . NO_CONTENT ) . send ( ) ;
77
+ return ;
78
+ }
64
79
65
80
logger . error ( "Not sure how to handle this error:" ) ;
66
81
logger . error ( e ) ;
You can’t perform that action at this time.
0 commit comments