Skip to content

Commit 0e85578

Browse files
aaemnnosttvbenbowler
authored andcommitted
Ignore fetch errors in deduplication middleware.
1 parent 947661d commit 0e85578

File tree

3 files changed

+42
-47
lines changed

3 files changed

+42
-47
lines changed

assets/js/googlesitekit/api/middleware/deduplication.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ function createDedupeMiddleware(
7373

7474
// Ensure the request entry is removed once the request
7575
// is completed regardless of any error.
76-
promise.finally( () => {
77-
concurrentRequests.delete( options );
78-
} );
76+
promise
77+
.catch( () => {
78+
// avoid an uncaught error here
79+
} )
80+
.finally( () => {
81+
concurrentRequests.delete( options );
82+
} );
7983

8084
return promise;
8185
};

assets/js/googlesitekit/api/middleware/equivalent-key-map.d.ts renamed to assets/js/types/equivalent-key-map.d.ts

File renamed without changes.

tsconfig.json

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,37 @@
11
{
2-
"compilerOptions": {
3-
"allowJs": true,
4-
"baseUrl": ".",
5-
"checkJs": false,
6-
"esModuleInterop": true,
7-
"jsx": "preserve",
8-
"noImplicitAny": true,
9-
"noEmit": true,
10-
"paths": {
11-
"@/*": [
12-
"./assets/*"
13-
],
14-
"googlesitekit-api": [
15-
"./assets/js/googlesitekit-api"
16-
],
17-
"googlesitekit-components": [
18-
"./assets/js/googlesitekit-components"
19-
],
20-
"googlesitekit-data": [
21-
"./assets/js/googlesitekit-data"
22-
],
23-
"googlesitekit-modules": [
24-
"./assets/js/googlesitekit-modules"
25-
],
26-
"googlesitekit-notifications": [
27-
"./assets/js/googlesitekit-notifications"
28-
],
29-
"googlesitekit-widgets": [
30-
"./assets/js/googlesitekit-widgets"
31-
],
32-
},
33-
"resolveJsonModule": true,
34-
"skipLibCheck": true,
35-
"strictNullChecks": true,
36-
"target": "es5"
37-
},
38-
"exclude": [
39-
"coverage",
40-
"dist",
41-
"node_modules",
42-
"php-scoper",
43-
"third-party",
44-
"vendor"
45-
]
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"baseUrl": ".",
5+
"checkJs": false,
6+
"esModuleInterop": true,
7+
"jsx": "preserve",
8+
"noImplicitAny": true,
9+
"noEmit": true,
10+
"paths": {
11+
"@/*": [ "./assets/*" ],
12+
"googlesitekit-api": [ "./assets/js/googlesitekit-api" ],
13+
"googlesitekit-components": [
14+
"./assets/js/googlesitekit-components"
15+
],
16+
"googlesitekit-data": [ "./assets/js/googlesitekit-data" ],
17+
"googlesitekit-modules": [ "./assets/js/googlesitekit-modules" ],
18+
"googlesitekit-notifications": [
19+
"./assets/js/googlesitekit-notifications"
20+
],
21+
"googlesitekit-widgets": [ "./assets/js/googlesitekit-widgets" ]
22+
},
23+
"resolveJsonModule": true,
24+
"skipLibCheck": true,
25+
"strictNullChecks": true,
26+
"target": "es5"
27+
},
28+
"include": [ "assets/js/types" ],
29+
"exclude": [
30+
"coverage",
31+
"dist",
32+
"node_modules",
33+
"php-scoper",
34+
"third-party",
35+
"vendor"
36+
]
4637
}

0 commit comments

Comments
 (0)