File tree Expand file tree Collapse file tree 2 files changed +4
-32
lines changed Expand file tree Collapse file tree 2 files changed +4
-32
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ export const api = async (
19
19
if ( logger ) {
20
20
logger . log ( 'HTTP Request:' , {
21
21
method,
22
+ host,
22
23
url,
23
- hasBody : ! ! data ,
24
24
body : data
25
25
} ) ;
26
26
}
@@ -36,39 +36,18 @@ export const api = async (
36
36
}
37
37
} ) ;
38
38
39
- const duration = Date . now ( ) - startTime ;
40
-
41
39
if ( logger ) {
42
- logger . log ( 'HTTP Response:' , {
43
- status : res . status ,
44
- statusText : res . statusText ,
45
- duration : `${ duration } ms` ,
46
- url
47
- } ) ;
40
+ logger . log ( 'HTTP Response:' , res ) ;
48
41
}
49
42
50
- try {
51
- const responseData = await res . json ( ) ;
52
-
53
- if ( logger ) {
54
- logger . log ( 'Response Data:' , responseData ) ;
55
- }
56
-
57
- return responseData ;
58
- } catch ( e ) {
59
- if ( logger ) {
60
- logger . warn ( 'Failed to parse response as JSON:' , e ) ;
61
- }
62
- return undefined ;
63
- }
43
+ return await res . json ( ) ;
64
44
} catch ( error ) {
65
45
const duration = Date . now ( ) - startTime ;
66
46
67
47
if ( logger ) {
68
48
logger . error ( 'HTTP Request Failed:' , {
69
49
error,
70
- duration : `${ duration } ms` ,
71
- url
50
+ duration : `${ duration } ms`
72
51
} ) ;
73
52
}
74
53
Original file line number Diff line number Diff line change @@ -293,15 +293,8 @@ export const NotificationAPIClientSDK: NotificationAPIClientSDK = {
293
293
let oldestReceived = params . before ;
294
294
let hasMore = true ;
295
295
let shouldLoadMore = true ;
296
- let fetchCount = 0 ;
297
296
298
297
while ( shouldLoadMore ) {
299
- fetchCount ++ ;
300
- NotificationAPIClientSDK . logger . log ( `Fetch attempt ${ fetchCount } ` , {
301
- oldestReceived,
302
- resultCount : result . length
303
- } ) ;
304
-
305
298
const res = await NotificationAPIClientSDK . rest . getNotifications (
306
299
oldestReceived ,
307
300
maxCountNeeded
You can’t perform that action at this time.
0 commit comments