Skip to content

Commit 58ce038

Browse files
committed
comments
1 parent 0433b57 commit 58ce038

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

lib/api.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export const api = async (
1919
if (logger) {
2020
logger.log('HTTP Request:', {
2121
method,
22+
host,
2223
url,
23-
hasBody: !!data,
2424
body: data
2525
});
2626
}
@@ -36,39 +36,18 @@ export const api = async (
3636
}
3737
});
3838

39-
const duration = Date.now() - startTime;
40-
4139
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);
4841
}
4942

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();
6444
} catch (error) {
6545
const duration = Date.now() - startTime;
6646

6747
if (logger) {
6848
logger.error('HTTP Request Failed:', {
6949
error,
70-
duration: `${duration}ms`,
71-
url
50+
duration: `${duration}ms`
7251
});
7352
}
7453

lib/client.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,8 @@ export const NotificationAPIClientSDK: NotificationAPIClientSDK = {
293293
let oldestReceived = params.before;
294294
let hasMore = true;
295295
let shouldLoadMore = true;
296-
let fetchCount = 0;
297296

298297
while (shouldLoadMore) {
299-
fetchCount++;
300-
NotificationAPIClientSDK.logger.log(`Fetch attempt ${fetchCount}`, {
301-
oldestReceived,
302-
resultCount: result.length
303-
});
304-
305298
const res = await NotificationAPIClientSDK.rest.getNotifications(
306299
oldestReceived,
307300
maxCountNeeded

0 commit comments

Comments
 (0)