@viamrobotics/test-widgets 0.10.1 → 0.10.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.
|
@@ -29,13 +29,18 @@
|
|
|
29
29
|
let errors = $state.raw<Error[]>([])
|
|
30
30
|
let data = $state.raw<unknown[]>([])
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const errorKey = (error: Error) => `${error.name}\0${error.message}`
|
|
33
|
+
const serializeErrors = (errs: Error[]) => errs.map((element) => errorKey(element)).join('\0\0')
|
|
34
|
+
const dedupeErrors = (errs: Error[]) => [
|
|
35
|
+
...new Map(errs.map((error) => [errorKey(error), error])).values(),
|
|
36
|
+
]
|
|
34
37
|
|
|
35
38
|
// Errors are null during loading, so keep the latest errors during polling.
|
|
36
39
|
// Only update errors if the content has changed to avoid re-rendering identical errors.
|
|
37
40
|
$effect.pre(() => {
|
|
38
|
-
const nextErrors =
|
|
41
|
+
const nextErrors = dedupeErrors(
|
|
42
|
+
queries.map((query) => query.error).filter((error) => error !== null)
|
|
43
|
+
)
|
|
39
44
|
if (nextErrors.length > 0) {
|
|
40
45
|
if (serializeErrors(nextErrors) !== serializeErrors(errors)) {
|
|
41
46
|
errors = nextErrors
|
|
@@ -61,7 +66,7 @@
|
|
|
61
66
|
{contentRect}
|
|
62
67
|
cx={contentCx}
|
|
63
68
|
>
|
|
64
|
-
{#each errors as error (
|
|
69
|
+
{#each errors as error (errorKey(error))}
|
|
65
70
|
<ErrorDisplay lastError={error} />
|
|
66
71
|
{/each}
|
|
67
72
|
</ContentRect>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamrobotics/test-widgets",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"wireit": {
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
"@playwright/test": "^1.59.1",
|
|
220
220
|
"@sentry/svelte": "^10.50.0",
|
|
221
221
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
222
|
-
"@sveltejs/kit": "^2.
|
|
222
|
+
"@sveltejs/kit": "^2.69.1",
|
|
223
223
|
"@sveltejs/package": "^2.5.7",
|
|
224
224
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
225
225
|
"@tailwindcss/postcss": "^4.2.4",
|