@internetarchive/ia-book-actions 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/config/url-helper.js +1 -0
- package/src/core/services/actions-handler/actions-handler-service.js +3 -1
- package/src/core/services/actions-handler/actions-handler.js +1 -0
- package/src/core/services/loan-token-poller.js +6 -0
- package/src/ia-book-actions.js +4 -0
package/package.json
CHANGED
|
@@ -258,6 +258,7 @@ export default class ActionsHandler extends LitElement {
|
|
|
258
258
|
// set new value
|
|
259
259
|
Cookies.setItem(storageKey, newCount, date, '/');
|
|
260
260
|
} catch (error) {
|
|
261
|
+
window?.Sentry?.captureException(error);
|
|
261
262
|
this.sendEvent('Cookies-Error-Actions', error);
|
|
262
263
|
}
|
|
263
264
|
}
|
|
@@ -21,6 +21,9 @@ export class LoanTokenPoller {
|
|
|
21
21
|
disconnectedInterval() {
|
|
22
22
|
clearInterval(this.loanTokenInterval);
|
|
23
23
|
this.loanTokenInterval = undefined;
|
|
24
|
+
if (window.Sentry) {
|
|
25
|
+
window?.Sentry?.captureMessage('loan token interval cleared');
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
async enableBookAccess() {
|
|
@@ -35,6 +38,7 @@ export class LoanTokenPoller {
|
|
|
35
38
|
);
|
|
36
39
|
consecutiveLoanCounts = existingCount ?? 1;
|
|
37
40
|
} catch (error) {
|
|
41
|
+
window?.Sentry?.captureException(error);
|
|
38
42
|
this.sendEvent('Cookies-Error-Token', error);
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -54,6 +58,7 @@ export class LoanTokenPoller {
|
|
|
54
58
|
|
|
55
59
|
this.sendEvent(category, action);
|
|
56
60
|
} else {
|
|
61
|
+
window?.Sentry?.captureMessage('enableBookAccess error');
|
|
57
62
|
// if book is not browsed, just clear token polling interval
|
|
58
63
|
this.disconnectedInterval(); // stop token fetch api
|
|
59
64
|
}
|
|
@@ -75,6 +80,7 @@ export class LoanTokenPoller {
|
|
|
75
80
|
identifier: this.identifier,
|
|
76
81
|
action,
|
|
77
82
|
error: data => {
|
|
83
|
+
window?.Sentry?.captureMessage('handleLoanTokenPoller error');
|
|
78
84
|
this.disconnectedInterval(); // stop token fetch api
|
|
79
85
|
this.errorCallback({ detail: { action, data } });
|
|
80
86
|
},
|
package/src/ia-book-actions.js
CHANGED
|
@@ -66,6 +66,8 @@ export default class IABookActions extends LitElement {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
disconnectedCallback() {
|
|
69
|
+
this.tokenPoller?.disconnectedInterval();
|
|
70
|
+
window?.Sentry?.captureMessage('disconnectedCallback');
|
|
69
71
|
this.disconnectResizeObserver();
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -167,6 +169,7 @@ export default class IABookActions extends LitElement {
|
|
|
167
169
|
'browsingExpired' in this.lendingStatus &&
|
|
168
170
|
this.lendingStatus?.browsingExpired;
|
|
169
171
|
if (hasExpired) {
|
|
172
|
+
window?.Sentry?.captureMessage('setupLendingToolbarActions hasExpired');
|
|
170
173
|
this.tokenPoller?.disconnectedInterval();
|
|
171
174
|
/** Global event - always fire */
|
|
172
175
|
this.dispatchEvent(
|
|
@@ -239,6 +242,7 @@ export default class IABookActions extends LitElement {
|
|
|
239
242
|
*/
|
|
240
243
|
startLoanTokenPoller() {
|
|
241
244
|
if (this.tokenPoller) {
|
|
245
|
+
window?.Sentry?.captureMessage('startLoanTokenPoller clearing interval');
|
|
242
246
|
this.tokenPoller.disconnectedInterval();
|
|
243
247
|
}
|
|
244
248
|
const successCallback = () => {
|