@exodus/error-tracking 3.1.0 → 3.1.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/CHANGELOG.md +12 -0
- package/index.js +4 -0
- package/package.json +2 -2
- package/plugin/index.js +2 -1
- package/plugin/why-is-remote-tracking-disabled.js +81 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/error-tracking@3.1.1...@exodus/error-tracking@3.1.2) (2025-09-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix: respect ab-testing variant for sentry [2] (#13783)
|
|
11
|
+
|
|
12
|
+
## [3.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/error-tracking@3.1.0...@exodus/error-tracking@3.1.1) (2025-08-25)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix: pass through experiment id, make naming less confusing (#13685)
|
|
17
|
+
|
|
6
18
|
## [3.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/error-tracking@3.0.1...@exodus/error-tracking@3.1.0) (2025-08-25)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const defaultConfig = {
|
|
|
10
10
|
maxErrorsCount: 100,
|
|
11
11
|
sentryConfig: undefined,
|
|
12
12
|
remoteErrorTrackingABExperimentId: 'sentry',
|
|
13
|
+
remoteErrorTrackingFundedWalletsABExperimentId: 'sentry-funded',
|
|
13
14
|
trackWalletsCreatedAfter: new Date('2025-07-21'),
|
|
14
15
|
trackFundedWallets: false,
|
|
15
16
|
}
|
|
@@ -18,6 +19,7 @@ const configSchema = {
|
|
|
18
19
|
maxErrorsCount: (value) => typeof value === 'number' && value > 0 && value <= 9999,
|
|
19
20
|
sentryConfig: '?Object',
|
|
20
21
|
remoteErrorTrackingABExperimentId: '?String',
|
|
22
|
+
remoteErrorTrackingFundedWalletsABExperimentId: '?String',
|
|
21
23
|
trackWalletsCreatedAfter: '?Date',
|
|
22
24
|
trackFundedWallets: '?Boolean',
|
|
23
25
|
}
|
|
@@ -29,6 +31,7 @@ const errorTracking = (config = Object.create(null)) => {
|
|
|
29
31
|
maxErrorsCount,
|
|
30
32
|
sentryConfig,
|
|
31
33
|
remoteErrorTrackingABExperimentId,
|
|
34
|
+
remoteErrorTrackingFundedWalletsABExperimentId,
|
|
32
35
|
trackWalletsCreatedAfter,
|
|
33
36
|
trackFundedWallets,
|
|
34
37
|
} = typeforce.parse(configSchema, config, true)
|
|
@@ -63,6 +66,7 @@ const errorTracking = (config = Object.create(null)) => {
|
|
|
63
66
|
definition: errorTrackingPluginDefinition,
|
|
64
67
|
config: {
|
|
65
68
|
remoteErrorTrackingABExperimentId,
|
|
69
|
+
remoteErrorTrackingFundedWalletsABExperimentId,
|
|
66
70
|
trackWalletsCreatedAfter,
|
|
67
71
|
trackFundedWallets,
|
|
68
72
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/error-tracking",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple error tracking package to let any feature collect errors and create the report",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e9f71532ea6dbf4d7c9c6b40a755f221a5fd1de2"
|
|
47
47
|
}
|
package/plugin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { combine, compute } from '@exodus/atoms'
|
|
2
2
|
|
|
3
|
-
import whyIsRemoteTrackingDisabled from './why-is-remote-tracking-disabled.js'
|
|
3
|
+
import { whyIsRemoteTrackingDisabled } from './why-is-remote-tracking-disabled.js'
|
|
4
4
|
|
|
5
5
|
function errorTrackingPlugin({
|
|
6
6
|
abTestingAtom,
|
|
@@ -42,6 +42,7 @@ function errorTrackingPlugin({
|
|
|
42
42
|
trackFundedWallets,
|
|
43
43
|
earliestTxDate,
|
|
44
44
|
buildMetadata: await getBuildMetadata(),
|
|
45
|
+
logger,
|
|
45
46
|
})
|
|
46
47
|
|
|
47
48
|
if (reasonDisabled) {
|
|
@@ -1,4 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
import typeforce from '@exodus/typeforce'
|
|
2
|
+
|
|
3
|
+
export class ErrorTrackingAbExperiment {
|
|
4
|
+
#experimentId
|
|
5
|
+
#abExperimentSchema = typeforce.maybe({
|
|
6
|
+
enabled: 'Boolean',
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
#abVariantSchema = typeforce.maybe({
|
|
10
|
+
value: 'String',
|
|
11
|
+
type: 'String',
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
#enabled
|
|
15
|
+
#variant
|
|
16
|
+
|
|
17
|
+
constructor({ experimentId, abTesting, logger }) {
|
|
18
|
+
if (!logger) {
|
|
19
|
+
throw new Error('logger is required')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
this.#experimentId = experimentId
|
|
23
|
+
|
|
24
|
+
if (experimentId) {
|
|
25
|
+
try {
|
|
26
|
+
const experimentParsed = typeforce.parse(
|
|
27
|
+
this.#abExperimentSchema,
|
|
28
|
+
abTesting?.experiments?.[experimentId],
|
|
29
|
+
true
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
const variantParsed = typeforce.parse(
|
|
33
|
+
this.#abVariantSchema,
|
|
34
|
+
abTesting?.variants?.[experimentId],
|
|
35
|
+
true
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
this.#enabled = experimentParsed?.enabled
|
|
39
|
+
this.#variant = variantParsed?.value
|
|
40
|
+
} catch {
|
|
41
|
+
// Attract attention to the issue and keep 'enabled' and 'variant' undefined to ensure remote tracking is disabled.
|
|
42
|
+
logger.debug(
|
|
43
|
+
`ErrorTrackingAbExperiment: failed to parse abTesting for experimentId: ${experimentId}`
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get hasExperimentId() {
|
|
50
|
+
return !!this.#experimentId
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get enabled() {
|
|
54
|
+
return this.#enabled
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get variant() {
|
|
58
|
+
return this.#variant
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function whyIsRemoteTrackingDisabled({
|
|
2
63
|
remoteErrorTrackingABExperimentId,
|
|
3
64
|
remoteErrorTrackingFundedWalletsABExperimentId,
|
|
4
65
|
abTesting,
|
|
@@ -7,15 +68,22 @@ export default function whyIsRemoteTrackingDisabled({
|
|
|
7
68
|
trackFundedWallets,
|
|
8
69
|
earliestTxDate,
|
|
9
70
|
buildMetadata,
|
|
71
|
+
logger,
|
|
10
72
|
}) {
|
|
11
73
|
if (buildMetadata.dev) return 'dev-mode'
|
|
12
74
|
|
|
13
|
-
|
|
14
|
-
|
|
75
|
+
const unfundedExperiment = new ErrorTrackingAbExperiment({
|
|
76
|
+
experimentId: remoteErrorTrackingABExperimentId,
|
|
77
|
+
abTesting,
|
|
78
|
+
logger,
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
if (!unfundedExperiment.hasExperimentId) return 'missing-ab-experiment-id'
|
|
82
|
+
if (!unfundedExperiment.enabled) {
|
|
15
83
|
return 'ab-experiment-disabled'
|
|
16
84
|
}
|
|
17
85
|
|
|
18
|
-
if (
|
|
86
|
+
if (unfundedExperiment.variant !== 'enabled') {
|
|
19
87
|
return 'ab-experiment-variant-disabled'
|
|
20
88
|
}
|
|
21
89
|
|
|
@@ -35,15 +103,21 @@ export default function whyIsRemoteTrackingDisabled({
|
|
|
35
103
|
}
|
|
36
104
|
|
|
37
105
|
// FUNDED WALLETS: separate AB experiment
|
|
38
|
-
|
|
106
|
+
const fundedExperiment = new ErrorTrackingAbExperiment({
|
|
107
|
+
experimentId: remoteErrorTrackingFundedWalletsABExperimentId,
|
|
108
|
+
abTesting,
|
|
109
|
+
logger,
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
if (!fundedExperiment.hasExperimentId) {
|
|
39
113
|
return 'missing-funded-wallets-ab-experiment-id'
|
|
40
114
|
}
|
|
41
115
|
|
|
42
|
-
if (!
|
|
116
|
+
if (!fundedExperiment.enabled) {
|
|
43
117
|
return 'funded-wallets-ab-experiment-disabled'
|
|
44
118
|
}
|
|
45
119
|
|
|
46
|
-
if (
|
|
120
|
+
if (fundedExperiment.variant !== 'enabled') {
|
|
47
121
|
return 'funded-wallets-ab-experiment-variant-disabled'
|
|
48
122
|
}
|
|
49
123
|
}
|