@openobserve/browser-core 0.3.3 → 0.3.4

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.
Files changed (83) hide show
  1. package/cjs/boot/init.js +1 -1
  2. package/cjs/domain/configuration/endpointBuilder.js +1 -1
  3. package/cjs/domain/tags.js +1 -1
  4. package/cjs/domain/telemetry/telemetry.js +1 -1
  5. package/cjs/domain/telemetry/telemetryEvent.types.d.ts +1 -1
  6. package/esm/boot/init.js +1 -1
  7. package/esm/domain/configuration/endpointBuilder.js +1 -1
  8. package/esm/domain/tags.js +1 -1
  9. package/esm/domain/telemetry/telemetry.js +1 -1
  10. package/esm/domain/telemetry/telemetryEvent.types.d.ts +1 -1
  11. package/package.json +2 -2
  12. package/src/boot/displayAlreadyInitializedError.spec.ts +18 -0
  13. package/src/boot/init.spec.ts +50 -0
  14. package/src/browser/addEventListener.spec.ts +141 -0
  15. package/src/browser/cookie.spec.ts +53 -0
  16. package/src/browser/fetchObservable.spec.ts +334 -0
  17. package/src/browser/pageMayExitObservable.spec.ts +56 -0
  18. package/src/browser/xhrObservable.spec.ts +405 -0
  19. package/src/domain/allowedTrackingOrigins.spec.ts +210 -0
  20. package/src/domain/bufferedData.spec.ts +34 -0
  21. package/src/domain/configuration/configuration.spec.ts +236 -0
  22. package/src/domain/configuration/endpointBuilder.spec.ts +173 -0
  23. package/src/domain/configuration/transportConfiguration.spec.ts +130 -0
  24. package/src/domain/connectivity/connectivity.spec.ts +50 -0
  25. package/src/domain/console/consoleObservable.spec.ts +151 -0
  26. package/src/domain/context/contextManager.spec.ts +152 -0
  27. package/src/domain/context/contextUtils.spec.ts +26 -0
  28. package/src/domain/context/storeContextManager.spec.ts +103 -0
  29. package/src/domain/contexts/accountContext.spec.ts +99 -0
  30. package/src/domain/contexts/globalContext.spec.ts +88 -0
  31. package/src/domain/contexts/userContext.spec.ts +156 -0
  32. package/src/domain/error/error.spec.ts +294 -0
  33. package/src/domain/error/trackRuntimeError.spec.ts +343 -0
  34. package/src/domain/eventRateLimiter/createEventRateLimiter.spec.ts +119 -0
  35. package/src/domain/extension/extensionUtils.spec.ts +47 -0
  36. package/src/domain/report/reportObservable.spec.ts +71 -0
  37. package/src/domain/session/oldCookiesMigration.spec.ts +76 -0
  38. package/src/domain/session/sessionManager.spec.ts +684 -0
  39. package/src/domain/session/sessionState.spec.ts +88 -0
  40. package/src/domain/session/sessionStore.spec.ts +647 -0
  41. package/src/domain/session/sessionStoreOperations.spec.ts +234 -0
  42. package/src/domain/session/storeStrategies/sessionInCookie.spec.ts +228 -0
  43. package/src/domain/session/storeStrategies/sessionInLocalStorage.spec.ts +75 -0
  44. package/src/domain/synthetics/syntheticsWorkerValues.spec.ts +82 -0
  45. package/src/domain/tags.spec.ts +74 -0
  46. package/src/domain/telemetry/telemetry.spec.ts +494 -0
  47. package/src/domain/telemetry/telemetryEvent.types.ts +1 -1
  48. package/src/domain/trackingConsent.spec.ts +44 -0
  49. package/src/tools/abstractHooks.spec.ts +76 -0
  50. package/src/tools/abstractLifeCycle.spec.ts +46 -0
  51. package/src/tools/boundedBuffer.spec.ts +40 -0
  52. package/src/tools/catchUserErrors.spec.ts +20 -0
  53. package/src/tools/encoder.spec.ts +112 -0
  54. package/src/tools/experimentalFeatures.spec.ts +60 -0
  55. package/src/tools/getZoneJsOriginalValue.spec.ts +36 -0
  56. package/src/tools/instrumentMethod.spec.ts +381 -0
  57. package/src/tools/matchOption.spec.ts +41 -0
  58. package/src/tools/mergeInto.spec.ts +198 -0
  59. package/src/tools/monitor.spec.ts +172 -0
  60. package/src/tools/observable.spec.ts +259 -0
  61. package/src/tools/queueMicrotask.spec.ts +24 -0
  62. package/src/tools/readBytesFromStream.spec.ts +62 -0
  63. package/src/tools/requestIdleCallback.spec.ts +65 -0
  64. package/src/tools/serialisation/jsonStringify.spec.ts +76 -0
  65. package/src/tools/serialisation/sanitize.spec.ts +284 -0
  66. package/src/tools/stackTrace/capturedExceptions.specHelper.ts +316 -0
  67. package/src/tools/stackTrace/computeStackTrace.spec.ts +1007 -0
  68. package/src/tools/stackTrace/handlingStack.spec.ts +20 -0
  69. package/src/tools/taskQueue.spec.ts +60 -0
  70. package/src/tools/timer.spec.ts +76 -0
  71. package/src/tools/utils/browserDetection.spec.ts +120 -0
  72. package/src/tools/utils/byteUtils.spec.ts +29 -0
  73. package/src/tools/utils/functionUtils.spec.ts +229 -0
  74. package/src/tools/utils/numberUtils.spec.ts +27 -0
  75. package/src/tools/utils/stringUtils.spec.ts +74 -0
  76. package/src/tools/utils/typeUtils.spec.ts +25 -0
  77. package/src/tools/utils/urlPolyfill.spec.ts +55 -0
  78. package/src/tools/valueHistory.spec.ts +180 -0
  79. package/src/transport/batch.spec.ts +261 -0
  80. package/src/transport/eventBridge.spec.ts +90 -0
  81. package/src/transport/flushController.spec.ts +267 -0
  82. package/src/transport/httpRequest.spec.ts +400 -0
  83. package/src/transport/sendWithRetryStrategy.spec.ts +393 -0
@@ -0,0 +1,316 @@
1
+ export const OPERA_25 = {
2
+ message: "Cannot read property 'undef' of null",
3
+ name: 'TypeError',
4
+ stack: `TypeError: Cannot read property 'undef' of null
5
+ at http://path/to/file.js:47:22
6
+ at foo (http://path/to/file.js:52:15)
7
+ at bar (http://path/to/file.js:108:168)`,
8
+ }
9
+
10
+ export const CHROME_15 = {
11
+ arguments: ['undef'],
12
+ message: "Object #<Object> has no method 'undef'",
13
+ stack: `TypeError: Object #<Object> has no method 'undef'
14
+ at bar (http://path/to/file.js:13:17)
15
+ at bar (http://path/to/file.js:16:5)
16
+ at foo (http://path/to/file.js:20:5)
17
+ at http://path/to/file.js:24:4`,
18
+ }
19
+
20
+ export const CHROME_36 = {
21
+ message: 'Default error',
22
+ name: 'Error',
23
+ stack: `Error: Default error
24
+ at dumpExceptionError (http://localhost:8080/file.js:41:27)
25
+ at HTMLButtonElement.onclick (http://localhost:8080/file.js:107:146)
26
+ at I.e.fn.(anonymous function) [as index] (http://localhost:8080/file.js:10:3651)`,
27
+ }
28
+
29
+ // can be generated when Webpack is built with { devtool: eval }
30
+ export const CHROME_XX_WEBPACK = {
31
+ message: "Cannot read property 'error' of undefined",
32
+ name: 'TypeError',
33
+ stack: `TypeError: Cannot read property 'error' of undefined
34
+ at TESTTESTTEST.eval(webpack:///./src/components/test/test.jsx?:295:108)
35
+ at TESTTESTTEST.render(webpack:///./src/components/test/test.jsx?:272:32)
36
+ at TESTTESTTEST.tryRender(webpack:///./~/react-transform-catch-errors/lib/index.js?:34:31)
37
+ at TESTTESTTEST.proxiedMethod(webpack:///./~/react-proxy/modules/createPrototypeProxy.js?:44:30)`,
38
+ }
39
+
40
+ export const ELECTRON = {
41
+ message: 'Default error',
42
+ name: 'Error',
43
+ stack: `Error: Default error
44
+ at dumpExceptionError (electron://-/file.js:41:27)
45
+ at HTMLButtonElement.onclick (electron://-/file.js:107:146)
46
+ at I.e.fn.(anonymous function) [as index] (electron://-/file.js:10:3651)`,
47
+ }
48
+
49
+ export const FIREFOX_3 = {
50
+ fileName: 'http://127.0.0.1:8000/js/stacktrace.js',
51
+ lineNumber: 44,
52
+ message: 'this.undef is not a function',
53
+ name: 'TypeError',
54
+ stack: `()@http://127.0.0.1:8000/js/stacktrace.js:44
55
+ (null)@http://127.0.0.1:8000/js/stacktrace.js:31
56
+ printStackTrace()@http://127.0.0.1:8000/js/stacktrace.js:18
57
+ bar(1)@http://127.0.0.1:8000/js/file.js:13
58
+ bar(2)@http://127.0.0.1:8000/js/file.js:16
59
+ foo()@http://127.0.0.1:8000/js/file.js:20
60
+ @http://127.0.0.1:8000/js/file.js:24
61
+ `,
62
+ }
63
+
64
+ export const FIREFOX_7 = {
65
+ fileName: 'file:///G:/js/stacktrace.js',
66
+ lineNumber: 44,
67
+ stack: `()@file:///G:/js/stacktrace.js:44
68
+ (null)@file:///G:/js/stacktrace.js:31
69
+ printStackTrace()@file:///G:/js/stacktrace.js:18
70
+ bar(1)@file:///G:/js/file.js:13
71
+ bar(2)@file:///G:/js/file.js:16
72
+ foo()@file:///G:/js/file.js:20
73
+ @file:///G:/js/file.js:24
74
+ `,
75
+ }
76
+
77
+ export const FIREFOX_14 = {
78
+ fileName: 'http://path/to/file.js',
79
+ lineNumber: 48,
80
+ message: 'x is null',
81
+ stack: `@http://path/to/file.js:48
82
+ dumpException3@http://path/to/file.js:52
83
+ onclick@http://path/to/file.js:1
84
+ `,
85
+ }
86
+
87
+ export const FIREFOX_31 = {
88
+ columnNumber: 12,
89
+ fileName: 'http://path/to/file.js',
90
+ lineNumber: 41,
91
+ message: 'Default error',
92
+ name: 'Error',
93
+ stack: `foo@http://path/to/file.js:41:13
94
+ bar@http://path/to/file.js:1:1
95
+ .plugin/e.fn[c]/<@http://path/to/file.js:1:1
96
+ `,
97
+ }
98
+
99
+ export const FIREFOX_43_EVAL = {
100
+ columnNumber: 30,
101
+ fileName: 'http://localhost:8080/file.js line 25 > eval line 2 > eval',
102
+ lineNumber: 1,
103
+ message: 'message string',
104
+ stack: `baz@http://localhost:8080/file.js line 26 > eval line 2 > eval:1:30
105
+ foo@http://localhost:8080/file.js line 26 > eval:2:96
106
+ @http://localhost:8080/file.js line 26 > eval:4:18
107
+ speak@http://localhost:8080/file.js:26:17
108
+ @http://localhost:8080/file.js:33:9`,
109
+ }
110
+
111
+ // Internal errors sometimes thrown by Firefox
112
+ // More here: https://developer.mozilla.org/en-US/docs/Mozilla/Errors
113
+ //
114
+ // Note that such errors are instanceof "Exception", not "Error"
115
+ export const FIREFOX_44_NS_EXCEPTION = {
116
+ columnNumber: 0,
117
+ fileName: 'http://path/to/file.js',
118
+ lineNumber: 703,
119
+ message: '',
120
+ name: 'NS_ERROR_FAILURE',
121
+ result: 2147500037,
122
+ stack: `[2]</Bar.prototype._baz/</<@http://path/to/file.js:703:28
123
+ App.prototype.foo@file:///path/to/file.js:15:2
124
+ bar@file:///path/to/file.js:20:3
125
+ @file:///path/to/index.html:23:1
126
+ `,
127
+ }
128
+
129
+ export const FIREFOX_50_RESOURCE_URL = {
130
+ columnNumber: 16,
131
+ fileName: 'resource://path/data/content/bundle.js',
132
+ lineNumber: 5529,
133
+ message: 'this.props.raw[this.state.dataSource].rows is undefined',
134
+ name: 'TypeError',
135
+ stack: `render@resource://path/data/content/bundle.js:5529:16
136
+ dispatchEvent@resource://path/data/content/vendor.bundle.js:18:23028
137
+ wrapped@resource://path/data/content/bundle.js:7270:25`,
138
+ }
139
+
140
+ export const SAFARI_6 = {
141
+ line: 48,
142
+ message: "'null' is not an object (evaluating 'x.undef')",
143
+ sourceURL: 'http://path/to/file.js',
144
+ stack: `@http://path/to/file.js:48
145
+ dumpException3@http://path/to/file.js:52
146
+ onclick@http://path/to/file.js:82
147
+ [native code]`,
148
+ }
149
+
150
+ export const SAFARI_7 = {
151
+ line: 47,
152
+ message: "'null' is not an object (evaluating 'x.undef')",
153
+ name: 'TypeError',
154
+ sourceURL: 'http://path/to/file.js',
155
+ stack: `http://path/to/file.js:48:22
156
+ foo@http://path/to/file.js:52:15
157
+ bar@http://path/to/file.js:108:107`,
158
+ }
159
+
160
+ export const SAFARI_8 = {
161
+ column: 22,
162
+ line: 47,
163
+ message: "null is not an object (evaluating 'x.undef')",
164
+ name: 'TypeError',
165
+ sourceURL: 'http://path/to/file.js',
166
+ stack: `http://path/to/file.js:47:22
167
+ foo@http://path/to/file.js:52:15
168
+ bar@http://path/to/file.js:108:23`,
169
+ }
170
+
171
+ export const SAFARI_8_EVAL = {
172
+ column: 18,
173
+ line: 1,
174
+ message: "Can't find variable: getExceptionProps",
175
+ name: 'ReferenceError',
176
+ stack: `eval code
177
+ eval@[native code]
178
+ foo@http://path/to/file.js:58:21
179
+ bar@http://path/to/file.js:109:91`,
180
+ }
181
+
182
+ export const IE_9 = {
183
+ description: "Unable to get property 'undef' of undefined or null reference",
184
+ message: "Unable to get property 'undef' of undefined or null reference",
185
+ }
186
+
187
+ export const IE_10 = {
188
+ description: "Unable to get property 'undef' of undefined or null reference",
189
+ message: "Unable to get property 'undef' of undefined or null reference",
190
+ number: -2146823281, // eslint-disable-line id-denylist
191
+ stack: `TypeError: Unable to get property 'undef' of undefined or null reference
192
+ at Anonymous function (http://path/to/file.js:48:13)
193
+ at foo (http://path/to/file.js:46:9)
194
+ at bar (http://path/to/file.js:82:1)`,
195
+ }
196
+
197
+ export const IE_11 = {
198
+ description: "Unable to get property 'undef' of undefined or null reference",
199
+ message: "Unable to get property 'undef' of undefined or null reference",
200
+ name: 'TypeError',
201
+ number: -2146823281, // eslint-disable-line id-denylist
202
+ stack: `TypeError: Unable to get property 'undef' of undefined or null reference
203
+ at Anonymous function (http://path/to/file.js:47:21)
204
+ at foo (http://path/to/file.js:45:13)
205
+ at bar (http://path/to/file.js:108:1)`,
206
+ }
207
+
208
+ export const IE_11_EVAL = {
209
+ description: "'getExceptionProps' is undefined",
210
+ message: "'getExceptionProps' is undefined",
211
+ name: 'ReferenceError',
212
+ number: -2146823279, // eslint-disable-line id-denylist
213
+ stack: `ReferenceError: 'getExceptionProps' is undefined
214
+ at eval code (eval code:1:1)
215
+ at foo (http://path/to/file.js:58:17)
216
+ at bar (http://path/to/file.js:109:1)`,
217
+ }
218
+
219
+ export const CHROME_48_BLOB = {
220
+ message: 'Error: test',
221
+ name: 'Error',
222
+ stack: `Error: test
223
+ at Error (native)
224
+ at s (blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379:31:29146)
225
+ at Object.d [as add] (blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379:31:30039)
226
+ at blob:http%3A//localhost%3A8080/d4eefe0f-361a-4682-b217-76587d9f712a:15:10978
227
+ at blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379:1:6911
228
+ at n.fire (blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379:7:3019)
229
+ at n.handle (blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379:7:2863)`,
230
+ }
231
+
232
+ export const CHROME_48_EVAL = {
233
+ message: 'message string',
234
+ name: 'Error',
235
+ stack: `Error: message string
236
+ at baz (eval at foo (eval at speak (http://localhost:8080/file.js:21:17)), <anonymous>:1:30)
237
+ at foo (eval at speak (http://localhost:8080/file.js:21:17), <anonymous>:2:96)
238
+ at eval (eval at speak (http://localhost:8080/file.js:21:17), <anonymous>:4:18)
239
+ at Object.speak (http://localhost:8080/file.js:21:17)
240
+ at http://localhost:8080/file.js:31:13\n`,
241
+ }
242
+
243
+ export const CHROME_111_SNIPPET = {
244
+ message: 'message string',
245
+ name: 'Error',
246
+ stack: `Error: message string
247
+ at snippet:///snippet_file:1:13`,
248
+ }
249
+
250
+ export const PHANTOMJS_1_19 = {
251
+ stack: `Error: foo
252
+ at file:///path/to/file.js:878
253
+ at foo (http://path/to/file.js:4283)
254
+ at http://path/to/file.js:4287`,
255
+ }
256
+
257
+ export const ANDROID_REACT_NATIVE = {
258
+ message: 'Error: test',
259
+ name: 'Error',
260
+ stack: `Error: test
261
+ at render(/home/username/sample-workspace/sampleapp.collect.react/src/components/GpsMonitorScene.js:78:24)
262
+ at _renderValidatedComponentWithoutOwnerOrContext(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1050:29)
263
+ at _renderValidatedComponent(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1075:15)
264
+ at renderedElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:484:29)
265
+ at _currentElement(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
266
+ at child(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
267
+ at children(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10)
268
+ at this(/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)\n`,
269
+ }
270
+
271
+ export const ANDROID_REACT_NATIVE_PROD = {
272
+ message: 'Error: test',
273
+ name: 'Error',
274
+ stack: `value@index.android.bundle:12:1917
275
+ onPress@index.android.bundle:12:2336
276
+ touchableHandlePress@index.android.bundle:258:1497
277
+ [native code]
278
+ _performSideEffectsForTransition@index.android.bundle:252:8508
279
+ [native code]
280
+ _receiveSignal@index.android.bundle:252:7291
281
+ [native code]
282
+ touchableHandleResponderRelease@index.android.bundle:252:4735
283
+ [native code]
284
+ u@index.android.bundle:79:142
285
+ invokeGuardedCallback@index.android.bundle:79:459
286
+ invokeGuardedCallbackAndCatchFirstError@index.android.bundle:79:580
287
+ c@index.android.bundle:95:365
288
+ a@index.android.bundle:95:567
289
+ v@index.android.bundle:146:501
290
+ g@index.android.bundle:146:604
291
+ forEach@[native code]
292
+ i@index.android.bundle:149:80
293
+ processEventQueue@index.android.bundle:146:1432
294
+ s@index.android.bundle:157:88
295
+ handleTopLevel@index.android.bundle:157:174
296
+ index.android.bundle:156:572
297
+ a@index.android.bundle:93:276
298
+ c@index.android.bundle:93:60
299
+ perform@index.android.bundle:177:596
300
+ batchedUpdates@index.android.bundle:188:464
301
+ i@index.android.bundle:176:358
302
+ i@index.android.bundle:93:90
303
+ u@index.android.bundle:93:150
304
+ _receiveRootNodeIDEvent@index.android.bundle:156:544
305
+ receiveTouches@index.android.bundle:156:918
306
+ value@index.android.bundle:29:3016
307
+ index.android.bundle:29:955
308
+ value@index.android.bundle:29:2417
309
+ value@index.android.bundle:29:927
310
+ [native code]`,
311
+ }
312
+
313
+ export const IOS_CAPACITOR = {
314
+ stack: `capacitor://localhost/media/dist/bundle.js:34:99546
315
+ r@capacitor://localhost/media/dist/bundle.js:34:47950`,
316
+ }