Skip to content

fix: always throw errors & always use named Error classes #1361

fix: always throw errors & always use named Error classes

fix: always throw errors & always use named Error classes #1361

Triggered via pull request November 19, 2024 18:21
Status Failure
Total duration 1m 49s
Artifacts

ts_test.yml

on: pull_request
List packages
6s
List packages
List examples
4s
List examples
Matrix: Build and test
Matrix: check_packages
Matrix: check_and_build_examples
Fit to window
Zoom out
Zoom in

Annotations

15 errors
Unhandled error: packages/typescript-client/src/error.ts#L42
FetchError: HTTP Error 400 at http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.ab3a91db9888c%22&where=1%3D1&offset=-1&handle=104345805-1732040589930: {"message":"The specified shape definition and handle do not match. Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one."} ❯ Function.fromResponse src/error.ts:42:12 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 ❯ src/fetch.ts:67:20 ❯ prefetchClient src/fetch.ts:136:22 ❯ ShapeStream.<anonymous> src/fetch.ts:166:22 ❯ ShapeStream.#start src/client.ts:368:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { url: 'http://localhost:3000/v1/shape?table=electric_test.%22issues+for+509504068_1_15_0.ab3a91db9888c%22&where=1%3D1&offset=-1&handle=104345805-1732040589930', status: 400, text: undefined, json: { message: 'The specified shape definition and handle do not match. Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one.' }, headers: { 'access-control-allow-methods': 'GET, HEAD, DELETE, OPTIONS', 'access-control-allow-origin': '*', 'access-control-expose-headers': '*', 'cache-control': 'max-age=0, private, must-revalidate', 'content-encoding': 'gzip', 'content-length': '140', 'content-type': 'application/json; charset=utf-8', date: 'Tue, 19 Nov 2024 18:23:09 GMT', server: 'ElectricSQL/0.8.2', vary: 'accept-encoding', 'x-request-id': 'GAlxvWUwSCi_6ocAACFh' } } This error originated in "test/integration.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "should handle invalid requests by terminating stream". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
Unhandled error: packages/typescript-client/src/parser.ts#L102
SyntaxError: Unexpected end of JSON input ❯ MessageParser.parse src/parser.ts:102:17 ❯ ShapeStream.#start src/client.ts:424:43 ❯ processTicksAndRejections node:internal/process/task_queues:95:5 This error originated in "test/client.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "should stop fetching and report an error if response is missing required headers". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
Unhandled error: packages/typescript-client/src/parser.ts#L102
SyntaxError: Unexpected end of JSON input ❯ MessageParser.parse src/parser.ts:102:17 ❯ ShapeStream.#start src/client.ts:424:43 This error originated in "test/client.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running. The latest test that might've caused the error is "should stop fetching and report an error if response is missing required headers". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
test/client.test.ts > Shape > should throw on a reserved parameter: packages/typescript-client/test/client.test.ts#L38
Error: Snapshot `Shape > should throw on a reserved parameter 1` mismatched Expected: "[Error: Cannot use reserved Electric parameter names in custom params: database_id]" Received: "[ReservedParamError: Cannot use reserved Electric parameter names in custom params: database_id]" ❯ test/client.test.ts:38:8
Build and test (packages/typescript-client)
Process completed with exit code 1.
test/react-hooks.test.tsx > useShape > should sync a shape: packages/react-hooks/test/react-hooks.test.tsx#L63
AssertionError: expected [] to deeply equal [ { …(2) } ] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> - Expected + Received - Array [ - Object { - "id": "01620287-411b-4693-aace-961fd835e89c", - "title": "test row", - }, - ] + Array [] ❯ test/react-hooks.test.tsx:63:35 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should re-sync a shape after an interrupt: packages/react-hooks/test/react-hooks.test.tsx#L96
AssertionError: expected [] to deeply equal [ { …(2) } ] Ignored nodes: comments, script, style <html> <head /> <body> <div /> <div /> </body> </html> - Expected + Received - Array [ - Object { - "id": "e3741f14-2111-4c01-8d26-ff2094157919", - "title": "test row", - }, - ] + Array [] ❯ test/react-hooks.test.tsx:96:35 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should expose isLoading status: packages/react-hooks/test/react-hooks.test.tsx#L114
AssertionError: expected true to be false // Object.is equality Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> - Expected + Received - false + true ❯ test/react-hooks.test.tsx:114:58 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should expose time at which we last synced: packages/react-hooks/test/react-hooks.test.tsx#L136
AssertionError: expected undefined to be defined Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> ❯ test/react-hooks.test.tsx:136:61 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should keep the state value in sync: packages/react-hooks/test/react-hooks.test.tsx#L157
AssertionError: expected [] to not deeply equal [] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> Compared values have no visual difference. ❯ test/react-hooks.test.tsx:157:57 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should let you change the shape definition (and clear the internal cache between): packages/react-hooks/test/react-hooks.test.tsx#L192
AssertionError: expected [] to deeply equal [ { …(2) } ] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> - Expected + Received - Array [ - Object { - "id": "71a67223-03a4-4d50-9f86-afebc8d4d10d", - "title": "test row", - }, - ] + Array [] ❯ test/react-hooks.test.tsx:192:35 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should allow use of the "selector" api from useSyncExternalStoreWithSelector: packages/react-hooks/test/react-hooks.test.tsx#L230
AssertionError: expected [] to deeply equal [ { …(2) } ] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> - Expected + Received - Array [ - Object { - "id": "dc9efa29-dc97-468c-bba7-f6ac75968ed7", - "title": "test row", - }, - ] + Array [] ❯ test/react-hooks.test.tsx:230:35 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should correctly reapply the selector to the data if it changes: packages/react-hooks/test/react-hooks.test.tsx#L275
AssertionError: expected [] to deeply equal [ { …(2) } ] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> - Expected + Received - Array [ - Object { - "id": "f1bba0dd-4983-46d0-8b5d-06e3d34a5585", - "title": "test row 2", - }, - ] + Array [] ❯ test/react-hooks.test.tsx:275:35 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
test/react-hooks.test.tsx > useShape > should unmount cleanly: packages/react-hooks/test/react-hooks.test.tsx#L301
AssertionError: expected [] to not deeply equal [] Ignored nodes: comments, script, style <html> <head /> <body> <div /> </body> </html> Compared values have no visual difference. ❯ test/react-hooks.test.tsx:301:57 ❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:47:12 ❯ checkCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:124:77 ❯ Timeout.checkRealTimersCallback ../../node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:118:16
Build and test (packages/react-hooks)
Process completed with exit code 1.