@shopgate/pwa-common 7.32.1 → 7.32.2-alpha.2
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/actions/app/handleLink.js +0 -5
- package/collections/AuthRoutes.js +0 -1
- package/collections/PersistedReducers.js +0 -1
- package/collections/media-providers/YouTube.js +0 -1
- package/components/I18n/components/Translate/index.js +0 -1
- package/components/Link/index.js +0 -1
- package/components/Router/index.js +0 -1
- package/helpers/config/index.d.ts.map +1 -1
- package/helpers/config/index.js +0 -2
- package/helpers/data/index.js +0 -3
- package/helpers/dom/index.js +0 -1
- package/helpers/html/handleDOM.js +0 -3
- package/helpers/i18n/getTranslator.js +0 -1
- package/helpers/i18n/mergeTranslations.js +0 -1
- package/helpers/redux/mutable.js +0 -2
- package/helpers/router/index.js +0 -3
- package/helpers/style/index.js +0 -1
- package/package.json +11 -7
- package/reducers/page/index.js +0 -1
- package/selectors/client.js +0 -1
- package/store/index.js +3 -13
- package/streams/main.js +1 -4
- package/subscriptions/error.js +102 -63
- package/subscriptions/helpers/handleLinks.js +0 -4
- package/subscriptions/router.js +0 -5
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
|
-
import "core-js/modules/web.url.js";
|
|
4
|
-
import "core-js/modules/web.url.to-json.js";
|
|
5
|
-
import "core-js/modules/web.url-search-params.js";
|
|
6
1
|
import { logger } from '@shopgate/pwa-core/helpers';
|
|
7
2
|
import { DEEPLINK_CART_ADD_PRODUCT_PATTERN } from '@shopgate/pwa-common-commerce/cart/constants';
|
|
8
3
|
import fetchProduct from '@shopgate/pwa-common-commerce/product/actions/fetchProduct';
|
package/components/Link/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { router, stack as routeStack, onDidPush, onDidPop, onDidReplace, onDidReset, onUpdate, ACTION_POP } from '@virtuous/conductor';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../helpers/config/index.js"],"names":[],"mappings":"AAwJA;;;;GAIG;AACH,yCAHW,MAAM,oBACN,mBAAmB,GAAC,IAAI,QAKlC;AA/GD;;GAEG;AACH,yBAFU,MAAM,CAEsB;AAWtC;;;GAGG;AACH,+BAFU,MAAM,CAKd;AASF;;;GAGG;AACH,wBAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,0BAFU,WAAW,CAEkC;AAEvD,yBAAyB;AACzB,8BAA8C;AAC9C,0BAA0B;AAC1B,+BAAgD;AAChD,4BAA4B;AAC5B,iCAAoD;AACpD,wBAAwB;AACxB,6BAA4C;AAK5C;;;;;;;;;;GAUG;AACH,2CANU,mBAAmB,CA8B3B;AAWK,gDAPI,MAAM,SACN,GAAC,SACD,GAAC,aACD,MAAM,aACN,MAAM,GACJ,OAAO,CAGK;AAiBzB,6BAAkE;;AA/FlE;;;;GAIG;AACH,6BAA8F"}
|
package/helpers/config/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.string.replace.js";
|
|
2
1
|
import pck from "../../package.json";
|
|
3
2
|
import { buildThemeConfig } from "./theme";
|
|
4
3
|
import { assignObjectDeep } from "../data";
|
|
@@ -27,7 +26,6 @@ const defaultAppConfig = {
|
|
|
27
26
|
shopCNAME: null,
|
|
28
27
|
currency: 'USD',
|
|
29
28
|
showGmdMenuSubHeaders: false,
|
|
30
|
-
benchmark: false,
|
|
31
29
|
sentry: {},
|
|
32
30
|
theme: {},
|
|
33
31
|
cartShippingHideAnonymousLegacy: null,
|
package/helpers/data/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
|
-
import "core-js/modules/es.array.reduce.js";
|
|
3
|
-
import "core-js/modules/es.string.replace.js";
|
|
4
1
|
import { logger } from '@shopgate/pwa-core/helpers';
|
|
5
2
|
import { isAndroidOs } from '@shopgate/pwa-core';
|
|
6
3
|
import { isObject, isArray } from "../validation";
|
package/helpers/dom/index.js
CHANGED
package/helpers/redux/mutable.js
CHANGED
package/helpers/router/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.reduce.js";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
|
-
import "core-js/modules/web.url-search-params.js";
|
|
4
1
|
import { createBrowserHistory } from 'history';
|
|
5
2
|
import { router } from '@virtuous/conductor';
|
|
6
3
|
import { logger } from '@shopgate/pwa-core/helpers';
|
package/helpers/style/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-common",
|
|
3
|
-
"version": "7.32.
|
|
3
|
+
"version": "7.32.2-alpha.2",
|
|
4
4
|
"description": "Common library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
7
|
-
"repository":
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/shopgate/pwa.git",
|
|
10
|
+
"directory": "libraries/common"
|
|
11
|
+
},
|
|
8
12
|
"bugs": "https://github.com/shopgate/pwa/issues",
|
|
9
13
|
"homepage": "https://github.com/shopgate/pwa/tree/master/libraries/common",
|
|
10
14
|
"keywords": [
|
|
@@ -16,8 +20,7 @@
|
|
|
16
20
|
],
|
|
17
21
|
"dependencies": {
|
|
18
22
|
"@redux-devtools/extension": "^3.3.0",
|
|
19
|
-
"@sentry/browser": "
|
|
20
|
-
"@shopgate/pwa-benchmark": "7.32.1",
|
|
23
|
+
"@sentry/browser": "^7.120.4",
|
|
21
24
|
"@virtuous/conductor": "~2.5.0",
|
|
22
25
|
"@virtuous/react-conductor": "~2.5.0",
|
|
23
26
|
"@virtuous/redux-persister": "1.1.0-beta.7",
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
"history": "^4.9.0",
|
|
29
32
|
"intl-messageformat": "^11.2.9",
|
|
30
33
|
"path-match": "^1.2.4",
|
|
34
|
+
"react-cookie": "^8.1.2",
|
|
31
35
|
"react-dotdotdot": "~1.3.1",
|
|
32
36
|
"react-helmet": "^6.1.0",
|
|
33
37
|
"react-portal": "^3.1.0",
|
|
@@ -40,10 +44,10 @@
|
|
|
40
44
|
"swiper": "12.2.0"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
|
-
"@shopgate/pwa-core": "7.32.
|
|
44
|
-
"@types/lodash": "^4.17.
|
|
47
|
+
"@shopgate/pwa-core": "7.32.2-alpha.2",
|
|
48
|
+
"@types/lodash": "^4.17.25",
|
|
45
49
|
"@types/react-portal": "^3.0.9",
|
|
46
|
-
"lodash": "^4.
|
|
50
|
+
"lodash": "^4.18.1",
|
|
47
51
|
"prop-types": "~15.8.1",
|
|
48
52
|
"react": "^17.0.2",
|
|
49
53
|
"react-dom": "^17.0.2"
|
package/reducers/page/index.js
CHANGED
package/selectors/client.js
CHANGED
package/store/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import "core-js/modules/es.string.replace.js";
|
|
2
1
|
import { createStore, applyMiddleware } from 'redux';
|
|
3
2
|
import { thunk } from 'redux-thunk';
|
|
4
3
|
import { composeWithDevTools } from '@redux-devtools/extension';
|
|
5
4
|
import { persistState } from '@virtuous/redux-persister';
|
|
6
|
-
import benchmarkMiddleware from '@shopgate/pwa-benchmark/profilers/redux';
|
|
7
|
-
import benchmarkController from '@shopgate/pwa-benchmark';
|
|
8
5
|
import persistedReducers from "../collections/PersistedReducers";
|
|
9
6
|
import initSubscribers from "../subscriptions";
|
|
10
|
-
import
|
|
7
|
+
import { themeName, shopNumber } from "../helpers/config";
|
|
11
8
|
import makeRootReducer from "../reducers";
|
|
12
9
|
import streams from "./middelwares/streams";
|
|
13
10
|
import logger from "./middelwares/logger";
|
|
@@ -31,7 +28,7 @@ function getInitialState() {
|
|
|
31
28
|
if (!storedState) {
|
|
32
29
|
return undefined;
|
|
33
30
|
}
|
|
34
|
-
const normalizedState = storedState.replace(
|
|
31
|
+
const normalizedState = storedState.replace(/"isFetching":true/g, '"isFetching":false');
|
|
35
32
|
return JSON.parse(normalizedState);
|
|
36
33
|
}
|
|
37
34
|
|
|
@@ -42,18 +39,11 @@ function getInitialState() {
|
|
|
42
39
|
* @return {Object} The redux store.
|
|
43
40
|
*/
|
|
44
41
|
export function configureStore(reducers, subscribers) {
|
|
45
|
-
|
|
46
|
-
if (appConfig.benchmark) {
|
|
47
|
-
benchmarkController.startup();
|
|
48
|
-
}
|
|
49
|
-
const store = createStore(makeRootReducer(reducers), getInitialState(), composeWithDevTools(applyMiddleware.apply(void 0, [thunk].concat(appConfig.benchmark ? [benchmarkMiddleware] : [], [streams, logger])), persistState({
|
|
42
|
+
const store = createStore(makeRootReducer(reducers), getInitialState(), composeWithDevTools(applyMiddleware.apply(void 0, [thunk, streams, logger]), persistState({
|
|
50
43
|
key: storeKey,
|
|
51
44
|
paths: persistedReducers.getAll()
|
|
52
45
|
})));
|
|
53
46
|
initSubscribers(subscribers);
|
|
54
|
-
if (window.Cypress) {
|
|
55
|
-
window.store = store;
|
|
56
|
-
}
|
|
57
47
|
return store;
|
|
58
48
|
}
|
|
59
49
|
|
package/streams/main.js
CHANGED
|
@@ -23,7 +23,4 @@ import { mainSubject } from "../store/middelwares/streams";
|
|
|
23
23
|
* Gets triggered on every redux action that is dispatched.
|
|
24
24
|
* @type {Observable}
|
|
25
25
|
*/
|
|
26
|
-
export const main$ = Observable.from(mainSubject);
|
|
27
|
-
if (window.Cypress) {
|
|
28
|
-
window.main$ = main$;
|
|
29
|
-
}
|
|
26
|
+
export const main$ = Observable.from(mainSubject);
|
package/subscriptions/error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
1
|
import { isAvailable } from '@shopgate/native-modules';
|
|
3
|
-
import { init, addBreadcrumb,
|
|
2
|
+
import { init, addBreadcrumb, setTags, captureException, captureMessage, captureEvent, withScope } from '@sentry/browser';
|
|
3
|
+
import { router } from '@virtuous/conductor';
|
|
4
4
|
import { EBIGAPI, emitter, errorManager, ETIMEOUT, ENETUNREACH, EUNKNOWN, EFAVORITE } from '@shopgate/pwa-core';
|
|
5
5
|
import { hasWebBridge } from '@shopgate/engage/core';
|
|
6
6
|
import { SOURCE_TRACKING, SOURCE_CONSOLE, Severity } from '@shopgate/pwa-core/constants/ErrorManager';
|
|
@@ -12,8 +12,6 @@ import { env } from "../helpers/environment";
|
|
|
12
12
|
import { transformGeneralPipelineError, getDisplayErrorMessage } from "./helpers/pipeline";
|
|
13
13
|
import { historyPop } from "../actions/router";
|
|
14
14
|
import showModal from "../actions/modal/showModal";
|
|
15
|
-
import { getUserData } from "../selectors/user";
|
|
16
|
-
import { userDidUpdate$ } from "../streams/user";
|
|
17
15
|
import { clientInformationDidUpdate$ } from "../streams/client";
|
|
18
16
|
import { appWillInit$, appWillStart$, appDidStart$ } from "../streams/app";
|
|
19
17
|
import { appError$, pipelineError$ } from "../streams/error";
|
|
@@ -24,11 +22,34 @@ import ToastProvider from "../providers/toast";
|
|
|
24
22
|
// Generic, translated fallback shown when a backend error carries no code we can map to a message.
|
|
25
23
|
const GENERIC_ERROR_MESSAGE = 'modal.body_error';
|
|
26
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @param {*} error The rejection reason or exception.
|
|
27
|
+
* @returns {boolean} Whether the error was created by the PipelineManager.
|
|
28
|
+
*/
|
|
29
|
+
const isPipelineError = error => !!error && typeof error.code === 'string' && typeof error.handled === 'boolean';
|
|
30
|
+
|
|
27
31
|
/**
|
|
28
32
|
* App errors subscriptions.
|
|
29
33
|
* @param {Function} subscribe The subscribe function.
|
|
30
34
|
*/
|
|
31
35
|
export default subscribe => {
|
|
36
|
+
subscribe(appWillInit$, () => {
|
|
37
|
+
window.addEventListener('unhandledrejection', event => {
|
|
38
|
+
const {
|
|
39
|
+
reason
|
|
40
|
+
} = event;
|
|
41
|
+
if (!isPipelineError(reason)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
if (env === 'development') {
|
|
46
|
+
const hint = reason.handled ? 'The default error handling already handled it' : 'The request excluded it from the default error handling (blacklisted or suppressed), so the action is expected to handle it';
|
|
47
|
+
// eslint-disable-next-line no-console
|
|
48
|
+
console.info(`Pipeline error not handled by the caller: ${reason.code} (${reason.message}). ${hint}; add .catch() if the caller needs to react.`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
32
53
|
/** Set general error transformations */
|
|
33
54
|
subscribe(appWillStart$, () => {
|
|
34
55
|
errorManager.setMessage({
|
|
@@ -160,16 +181,30 @@ export default subscribe => {
|
|
|
160
181
|
return;
|
|
161
182
|
}
|
|
162
183
|
const severityMap = {
|
|
163
|
-
[Severity.Fatal]:
|
|
164
|
-
[Severity.Error]:
|
|
165
|
-
[Severity.Critical]:
|
|
166
|
-
[Severity.Warning]:
|
|
167
|
-
[Severity.Info]:
|
|
168
|
-
[Severity.Debug]:
|
|
184
|
+
[Severity.Fatal]: 'fatal',
|
|
185
|
+
[Severity.Error]: 'error',
|
|
186
|
+
[Severity.Critical]: 'fatal',
|
|
187
|
+
[Severity.Warning]: 'warning',
|
|
188
|
+
[Severity.Info]: 'info',
|
|
189
|
+
[Severity.Debug]: 'debug'
|
|
169
190
|
};
|
|
170
191
|
const ignoredDefaultBreadcrumbs = ['console', 'fetch', 'xhr', 'ui.click'];
|
|
171
|
-
|
|
172
|
-
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @param {string} url An absolute or relative URL of the app.
|
|
195
|
+
* @returns {string} The URL with its route path replaced by the route pattern, e.g.
|
|
196
|
+
* `/orders/:orderId`, and without query string and hash.
|
|
197
|
+
*/
|
|
198
|
+
const redactUrl = url => {
|
|
199
|
+
if (typeof url !== 'string') {
|
|
200
|
+
return url;
|
|
201
|
+
}
|
|
202
|
+
const [path] = url.split(/[?#]/);
|
|
203
|
+
const [, base, routePath] = /^(.*?index\.html)(.*)$/.exec(path) || /^([a-z][a-z\d+.-]*:\/\/[^/]+)(.*)$/i.exec(path) || [null, '', path];
|
|
204
|
+
return `${base}${router.findPattern(routePath || '/') || '/(unknown route)'}`;
|
|
205
|
+
};
|
|
206
|
+
let trackedSeverities = Object.values(severityMap);
|
|
207
|
+
const minSeverityIndex = Object.keys(severityMap).indexOf(level);
|
|
173
208
|
if (minSeverityIndex > -1) {
|
|
174
209
|
trackedSeverities = trackedSeverities.slice(0, minSeverityIndex + 1);
|
|
175
210
|
}
|
|
@@ -183,39 +218,60 @@ export default subscribe => {
|
|
|
183
218
|
release: pckVersion,
|
|
184
219
|
attachStacktrace: true,
|
|
185
220
|
sampleRate,
|
|
221
|
+
ignoreErrors: [/play\(\) failed because the user didn't interact/],
|
|
186
222
|
beforeBreadcrumb(breadcrumb) {
|
|
187
223
|
if (ignoredDefaultBreadcrumbs.includes(breadcrumb.category)) {
|
|
188
224
|
return null;
|
|
189
225
|
}
|
|
226
|
+
if (breadcrumb.category === 'navigation' && breadcrumb.data) {
|
|
227
|
+
return {
|
|
228
|
+
...breadcrumb,
|
|
229
|
+
data: {
|
|
230
|
+
from: redactUrl(breadcrumb.data.from),
|
|
231
|
+
to: redactUrl(breadcrumb.data.to)
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
190
235
|
return breadcrumb;
|
|
191
236
|
},
|
|
192
|
-
beforeSend(event) {
|
|
237
|
+
beforeSend(event, hint) {
|
|
193
238
|
if (event.level && !trackedSeverities.includes(event.level)) {
|
|
194
239
|
return null;
|
|
195
240
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
241
|
+
if (isPipelineError(hint?.originalException)) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
...event,
|
|
246
|
+
request: event.request && {
|
|
247
|
+
...event.request,
|
|
248
|
+
url: redactUrl(event.request.url),
|
|
249
|
+
headers: event.request.headers && {
|
|
250
|
+
...event.request.headers,
|
|
251
|
+
Referer: redactUrl(event.request.headers.Referer)
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
extra: {
|
|
255
|
+
...(event.extra || {}),
|
|
256
|
+
routerStack: getRouterStack(getState()).slice(-5).map(({
|
|
257
|
+
pattern
|
|
258
|
+
}) => ({
|
|
259
|
+
pattern
|
|
260
|
+
}))
|
|
261
|
+
}
|
|
200
262
|
};
|
|
201
|
-
return event;
|
|
202
263
|
}
|
|
203
264
|
});
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
265
|
+
setTags({
|
|
266
|
+
marketId: appConfig.marketId,
|
|
267
|
+
appId: appConfig.appId,
|
|
268
|
+
pwaVersion: pckVersion,
|
|
269
|
+
theme: themeName,
|
|
270
|
+
language: appConfig.language,
|
|
271
|
+
isWebsite: hasWebBridge(),
|
|
272
|
+
isReactNativeApp: isAvailable(),
|
|
273
|
+
merchantCode: appConfig.omniMerchantCode
|
|
213
274
|
});
|
|
214
|
-
if (window) {
|
|
215
|
-
window.onerror = (message, source, lineno, colno, error) => {
|
|
216
|
-
captureException(error);
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
275
|
emitter.addListener(SOURCE_TRACKING, error => {
|
|
220
276
|
withScope(scope => {
|
|
221
277
|
if (error.context) {
|
|
@@ -226,8 +282,8 @@ export default subscribe => {
|
|
|
226
282
|
});
|
|
227
283
|
emitter.addListener(SOURCE_CONSOLE, args => {
|
|
228
284
|
withScope(scope => {
|
|
229
|
-
scope.setLevel(
|
|
230
|
-
scope.setExtra('error', args);
|
|
285
|
+
scope.setLevel('error');
|
|
286
|
+
scope.setExtra('error', args.map(arg => arg instanceof Error ? arg.message : String(arg)));
|
|
231
287
|
captureMessage('Console error');
|
|
232
288
|
});
|
|
233
289
|
});
|
|
@@ -238,20 +294,7 @@ export default subscribe => {
|
|
|
238
294
|
addBreadcrumb({
|
|
239
295
|
category: 'redux',
|
|
240
296
|
message: `[Redux] ${action.type}`,
|
|
241
|
-
level:
|
|
242
|
-
data: {
|
|
243
|
-
...action
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
subscribe(userDidUpdate$, ({
|
|
248
|
-
getState
|
|
249
|
-
}) => {
|
|
250
|
-
const {
|
|
251
|
-
id: userId
|
|
252
|
-
} = getUserData(getState());
|
|
253
|
-
configureScope(scope => {
|
|
254
|
-
scope.setTag('userId', userId);
|
|
297
|
+
level: 'info'
|
|
255
298
|
});
|
|
256
299
|
});
|
|
257
300
|
|
|
@@ -261,20 +304,18 @@ export default subscribe => {
|
|
|
261
304
|
}) => {
|
|
262
305
|
const {
|
|
263
306
|
appVersion,
|
|
264
|
-
libVersion
|
|
265
|
-
deviceId
|
|
307
|
+
libVersion
|
|
266
308
|
} = action.data;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
scope.setTag('deviceId', deviceId);
|
|
309
|
+
setTags({
|
|
310
|
+
appVersion,
|
|
311
|
+
libVersion
|
|
271
312
|
});
|
|
272
313
|
});
|
|
273
314
|
|
|
274
315
|
// Add app start event for debugging
|
|
275
316
|
subscribe(appDidStart$, () => {
|
|
276
317
|
withScope(scope => {
|
|
277
|
-
scope.setLevel(
|
|
318
|
+
scope.setLevel('debug');
|
|
278
319
|
captureMessage('App did start');
|
|
279
320
|
});
|
|
280
321
|
});
|
|
@@ -299,19 +340,17 @@ export default subscribe => {
|
|
|
299
340
|
error = {}
|
|
300
341
|
} = action;
|
|
301
342
|
const {
|
|
302
|
-
code
|
|
303
|
-
message,
|
|
304
|
-
meta: {
|
|
305
|
-
message: metaMessage
|
|
306
|
-
} = {}
|
|
343
|
+
code
|
|
307
344
|
} = error;
|
|
308
345
|
withScope(scope => {
|
|
309
346
|
scope.setTag('error', 'E_USER');
|
|
310
347
|
scope.setTag('errorCode', code);
|
|
311
|
-
scope.setTag('errorMessage', message);
|
|
312
348
|
captureEvent({
|
|
313
|
-
message:
|
|
314
|
-
extra:
|
|
349
|
+
message: code ? `User error ${code}` : 'User error',
|
|
350
|
+
extra: {
|
|
351
|
+
code,
|
|
352
|
+
pipeline: error.context
|
|
353
|
+
}
|
|
315
354
|
});
|
|
316
355
|
});
|
|
317
356
|
});
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
|
-
import "core-js/modules/web.url.js";
|
|
3
|
-
import "core-js/modules/web.url.to-json.js";
|
|
4
|
-
import "core-js/modules/web.url-search-params.js";
|
|
5
1
|
import { router, ACTION_REPLACE } from '@virtuous/conductor';
|
|
6
2
|
import flushTab from '@shopgate/pwa-core/commands/flushTab';
|
|
7
3
|
import openPage from '@shopgate/pwa-core/commands/openPage';
|
package/subscriptions/router.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.includes.js";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
|
-
import "core-js/modules/web.url.js";
|
|
4
|
-
import "core-js/modules/web.url.to-json.js";
|
|
5
|
-
import "core-js/modules/web.url-search-params.js";
|
|
6
1
|
import queryString from 'query-string';
|
|
7
2
|
import { router, ACTION_POP, ACTION_PUSH, ACTION_REPLACE, ACTION_RESET } from '@virtuous/conductor';
|
|
8
3
|
import Route from '@virtuous/conductor/Route';
|