Skip to content

feat: return file hash from uploaded object #4641

feat: return file hash from uploaded object

feat: return file hash from uploaded object #4641

Triggered via pull request September 26, 2024 21:29
Status Failure
Total duration 1m 47s
Artifacts 2

ci.yaml

on: pull_request
Matrix: analyze-bundle
bundle-analyze-result
44s
bundle-analyze-result
Fit to window
Zoom out
Zoom in

Annotations

15 errors
test/client.test.ts > uploadFiles > uploads file using presigned PUT: packages/uploadthing/test/client.test.ts#L124
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ] - Expected + Received Array [ Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "foo.txt", "serverData": null, "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, ] ❯ test/client.test.ts:124:5
test/client.test.ts > uploadFiles > sends custom headers if set (static object): packages/uploadthing/test/client.test.ts#L163
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ] - Expected + Received Array [ Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "foo.txt", "serverData": null, "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, ] ❯ test/client.test.ts:163:5
test/client.test.ts > uploadFiles > sends custom headers if set (async function): packages/uploadthing/test/client.test.ts#L198
AssertionError: expected [ { name: 'foo.txt', size: 3, …(8) } ] to deeply equal [ { name: 'foo.txt', size: 3, …(8) } ] - Expected + Received Array [ Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/app-1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "foo.txt", "serverData": null, "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, ] ❯ test/client.test.ts:198:5
test/sdk.test.ts > uploadFiles > uploads successfully: packages/uploadthing/test/sdk.test.ts#L47
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { data: { …(9) }, error: null } - Expected + Received Object { "data": Object { "appUrl": "https://utfs.io/a/app-1/u7rKiJYp268seyXN4iERSnf5E7mJgIFqsQM62cNpjouxyi3X", "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": 1727386237904, "name": "foo.txt", "size": 3, "type": "text/plain", "url": "https://utfs.io/f/u7rKiJYp268seyXN4iERSnf5E7mJgIFqsQM62cNpjouxyi3X", }, "error": null, } ❯ test/sdk.test.ts:47:20
test/sdk.test.ts > uploadFilesFromUrl > downloads, then uploads successfully: packages/uploadthing/test/sdk.test.ts#L130
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { data: { …(9) }, error: null } - Expected + Received Object { "data": Object { "appUrl": "https://utfs.io/a/app-1/u7rKiJYp268skhH2rhvuZaFbQOrV90MKDzPohfTXwgpCvYWq", "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "foo.txt", "size": 26, "type": "text/plain", "url": "https://utfs.io/f/u7rKiJYp268skhH2rhvuZaFbQOrV90MKDzPohfTXwgpCvYWq", }, "error": null, } ❯ test/sdk.test.ts:130:20
test/sdk.test.ts > uploadFilesFromUrl > preserves order if some download fails: packages/uploadthing/test/sdk.test.ts#L229
AssertionError: expected [ …(3) ] to strictly equal [ …(3) ] - Expected + Received Array [ Object { "data": Object { "appUrl": "https://utfs.io/a/app-1/u7rKiJYp268sVvNsG1jXiCAWDk13YnIKosJbx5Pg6e8Qtcmz", "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "foo.txt", "size": 26, "type": "text/plain", "url": "https://utfs.io/f/u7rKiJYp268sVvNsG1jXiCAWDk13YnIKosJbx5Pg6e8Qtcmz", }, "error": null, }, Object { "data": null, "error": Object { "code": "BAD_REQUEST", "data": undefined, "message": "Please use uploadFiles() for data URLs. uploadFilesFromUrl() is intended for use with remote URLs only.", }, }, Object { "data": Object { "appUrl": "https://utfs.io/a/app-1/u7rKiJYp268smtmrGEg75k3SVGs6EpbMDPafuF28WerKyAwx", "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "bar.txt", "size": 26, "type": "text/plain", "url": "https://utfs.io/f/u7rKiJYp268smtmrGEg75k3SVGs6EpbMDPafuF28WerKyAwx", }, "error": null, }, ] ❯ test/sdk.test.ts:229:20
test/sdk.test.ts > smoke test with live api > should upload a file: packages/uploadthing/test/sdk.test.ts#L470
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) } - Expected + Received Object { "data": Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": 1727386240110, "name": "foo.txt", "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, "error": null, } ❯ test/sdk.test.ts:470:22
test/sdk.test.ts > smoke test with live api > should upload a private file: packages/uploadthing/test/sdk.test.ts#L506
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) } - Expected + Received Object { "data": Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": 1727386241975, "name": "foo.txt", "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, "error": null, } ❯ test/sdk.test.ts:506:22
test/sdk.test.ts > smoke test with live api > should upload a file from a url: packages/uploadthing/test/sdk.test.ts#L537
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) } - Expected + Received Object { "data": Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "favicon.ico", "size": Any<Number>, "type": "image/vnd.microsoft.icon", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, "error": null, } ❯ test/sdk.test.ts:537:22
test/sdk.test.ts > smoke test with live api > should rename a file with fileKey: packages/uploadthing/test/sdk.test.ts#L562
AssertionError: expected { data: { …(9) }, error: null } to deeply equal { Object (data, error) } - Expected + Received Object { "data": Object { "appUrl": StringMatching /^https:\/\/utfs.io\/a\/fr0hfwpst1\/.+$/, "customId": null, - "hash": Any<String>, + "fileHash": undefined, "key": StringMatching /.+/, "lastModified": Any<Number>, "name": "bar.txt", "size": 3, "type": "text/plain", "url": StringMatching /^https:\/\/utfs.io\/f\/.+$/, }, "error": null, } ❯ test/sdk.test.ts:562:22
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
typecheck
Object literal may only specify known properties, and 'hash' does not exist in type '{ readonly name: string; readonly size: number; readonly type: string; readonly lastModified?: number | undefined; readonly customId: string | null; readonly key: string; readonly url: string; readonly appUrl: string; readonly fileHash: string; }'.
typecheck
uploadthing#typecheck: command (/home/runner/work/uploadthing/uploadthing/packages/uploadthing) /home/runner/setup-pnpm/node_modules/.bin/pnpm run typecheck exited (2)
typecheck
Process completed with exit code 2.

Artifacts

Produced during runtime
Name Size
bundle-current-pr Expired
45 KB
bundle-main Expired
45 KB