From 24d29e0da8169576f5697434154220d51301b93e Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 10 Jun 2024 20:05:01 +0000 Subject: [PATCH 01/10] chore(deps): update biome to v1.8.1 --- package.json | 10 +++--- pnpm-lock.yaml | 92 ++++++++++++++++++++++++++------------------------ 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index f2c7938d35..1b78c3fe93 100644 --- a/package.json +++ b/package.json @@ -41,11 +41,11 @@ "js-yaml": "4.1.0" }, "devDependencies": { - "@biomejs/biome": "1.8.0", - "@biomejs/cli-darwin-arm64": "1.8.0", - "@biomejs/cli-darwin-x64": "1.8.0", - "@biomejs/cli-linux-arm64": "1.8.0", - "@biomejs/cli-linux-x64": "1.8.0", + "@biomejs/biome": "1.8.1", + "@biomejs/cli-darwin-arm64": "1.8.1", + "@biomejs/cli-darwin-x64": "1.8.1", + "@biomejs/cli-linux-arm64": "1.8.1", + "@biomejs/cli-linux-x64": "1.8.1", "@types/node": "20.14.2", "execa": "9.2.0", "pnpm": "9.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7629a96c0f..796abbcf59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,20 +13,20 @@ importers: version: 4.1.0 devDependencies: '@biomejs/biome': - specifier: 1.8.0 - version: 1.8.0 + specifier: 1.8.1 + version: 1.8.1 '@biomejs/cli-darwin-arm64': - specifier: 1.8.0 - version: 1.8.0 + specifier: 1.8.1 + version: 1.8.1 '@biomejs/cli-darwin-x64': - specifier: 1.8.0 - version: 1.8.0 + specifier: 1.8.1 + version: 1.8.1 '@biomejs/cli-linux-arm64': - specifier: 1.8.0 - version: 1.8.0 + specifier: 1.8.1 + version: 1.8.1 '@biomejs/cli-linux-x64': - specifier: 1.8.0 - version: 1.8.0 + specifier: 1.8.1 + version: 1.8.1 '@types/node': specifier: 20.14.2 version: 20.14.2 @@ -1138,55 +1138,55 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@biomejs/biome@1.8.0': - resolution: {integrity: sha512-34xcE2z8GWrIz1sCFEmlHT/+4d+SN7YOqqvzlAKXKvaWPRJ2/NUwxPbRsP01P9QODkQ5bvGvc9rpBihmP+7RJQ==} + '@biomejs/biome@1.8.1': + resolution: {integrity: sha512-fQXGfvq6DIXem12dGQCM2tNF+vsNHH1qs3C7WeOu75Pd0trduoTmoO7G4ntLJ2qDs5wuw981H+cxQhi1uHnAtA==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@1.8.0': - resolution: {integrity: sha512-dBAYzfIJ1JmWigKlWourT3sJ3I60LZPjqNwwlsyFjiv5AV7vPeWlHVVIImV2BpINwNjZQhpXnwDfVnGS4vr7AA==} + '@biomejs/cli-darwin-arm64@1.8.1': + resolution: {integrity: sha512-XLiB7Uu6GALIOBWzQ2aMD0ru4Ly5/qSeQF7kk3AabzJ/kwsEWSe33iVySBP/SS2qv25cgqNiLksjGcw2bHT3mw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@1.8.0': - resolution: {integrity: sha512-ZTTSD0bP0nn9UpRDGQrQNTILcYSj+IkxTYr3CAV64DWBDtQBomlk2oVKWzDaA1LOhpAsTh0giLCbPJaVk2jfMQ==} + '@biomejs/cli-darwin-x64@1.8.1': + resolution: {integrity: sha512-uMTSxVLMfqkBVqyc25hSn83jBbp+wtWjzM/pHFlKXt3htJuw7FErVGW0nmQ9Sxa9vJ7GcqoltLMl28VQRIMYzg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@1.8.0': - resolution: {integrity: sha512-+ee/pZWsvhDv6eRI00krRNSgAg8DKSxzOv3LUsCjto6N1VzqatTASeQv2HRfG1nitf79rRKM75LkMJbqEfiKww==} + '@biomejs/cli-linux-arm64-musl@1.8.1': + resolution: {integrity: sha512-UQ8Wc01J0wQL+5AYOc7qkJn20B4PZmQL1KrmDZh7ot0DvD6aX4+8mmfd/dG5b6Zjo/44QvCKcvkFGCMRYuhWZA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@1.8.0': - resolution: {integrity: sha512-cx725jTlJS6dskvJJwwCQaaMRBKE2Qss7ukzmx27Rn/DXRxz6tnnBix4FUGPf1uZfwrERkiJlbWM05JWzpvvXg==} + '@biomejs/cli-linux-arm64@1.8.1': + resolution: {integrity: sha512-3SzZRuC/9Oi2P2IBNPsEj0KXxSXUEYRR2kfRF/Ve8QAfGgrt4qnwuWd6QQKKN5R+oYH691qjm+cXBKEcrP1v/Q==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@1.8.0': - resolution: {integrity: sha512-VPA4ocrAOak50VYl8gOAVnjuFFDpIUolShntc/aWM0pZfSIMbRucxnrfUfp44EVwayxjK6ruJTR5xEWj93WvDA==} + '@biomejs/cli-linux-x64-musl@1.8.1': + resolution: {integrity: sha512-fYbP/kNu/rtZ4kKzWVocIdqZOtBSUEg9qUhZaao3dy3CRzafR6u6KDtBeSCnt47O+iLnks1eOR1TUxzr5+QuqA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@1.8.0': - resolution: {integrity: sha512-cmgmhlD4QUxMhL1VdaNqnB81xBHb3R7huVNyYnPYzP+AykZ7XqJbPd1KcWAszNjUk2AHdx0aLKEBwCOWemxb2g==} + '@biomejs/cli-linux-x64@1.8.1': + resolution: {integrity: sha512-AeBycVdNrTzsyYKEOtR2R0Ph0hCD0sCshcp2aOnfGP0hCZbtFg09D0SdKLbyzKntisY41HxKVrydYiaApp+2uw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@1.8.0': - resolution: {integrity: sha512-J31spvlh39FfRHQacYXxJX9PvTCH/a8+2Jx9D1lxw+LSF0JybqZcw/4JrlFUWUl4kF3yv8AuYUK0sENScc3g9w==} + '@biomejs/cli-win32-arm64@1.8.1': + resolution: {integrity: sha512-6tEd1H/iFKpgpE3OIB7oNgW5XkjiVMzMRPL8zYoZ036YfuJ5nMYm9eB9H/y81+8Z76vL48fiYzMPotJwukGPqQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@1.8.0': - resolution: {integrity: sha512-uPHHvu76JC1zYe9zZDcOU9PAg+1MZmPuNgWkb5jljaDeATvzLFPB+0nuJTilf603LXL+E8IdPQAO61Wy2VuEJA==} + '@biomejs/cli-win32-x64@1.8.1': + resolution: {integrity: sha512-g2H31jJzYmS4jkvl6TiyEjEX+Nv79a5km/xn+5DARTp5MBFzC9gwceusSSB2AkJKqZzY131AiACAWjKrVt5Ijw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -1518,6 +1518,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1525,6 +1526,7 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@humanwhocodes/retry@0.3.0': resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} @@ -8314,35 +8316,35 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@biomejs/biome@1.8.0': + '@biomejs/biome@1.8.1': optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.8.0 - '@biomejs/cli-darwin-x64': 1.8.0 - '@biomejs/cli-linux-arm64': 1.8.0 - '@biomejs/cli-linux-arm64-musl': 1.8.0 - '@biomejs/cli-linux-x64': 1.8.0 - '@biomejs/cli-linux-x64-musl': 1.8.0 - '@biomejs/cli-win32-arm64': 1.8.0 - '@biomejs/cli-win32-x64': 1.8.0 + '@biomejs/cli-darwin-arm64': 1.8.1 + '@biomejs/cli-darwin-x64': 1.8.1 + '@biomejs/cli-linux-arm64': 1.8.1 + '@biomejs/cli-linux-arm64-musl': 1.8.1 + '@biomejs/cli-linux-x64': 1.8.1 + '@biomejs/cli-linux-x64-musl': 1.8.1 + '@biomejs/cli-win32-arm64': 1.8.1 + '@biomejs/cli-win32-x64': 1.8.1 - '@biomejs/cli-darwin-arm64@1.8.0': {} + '@biomejs/cli-darwin-arm64@1.8.1': {} - '@biomejs/cli-darwin-x64@1.8.0': {} + '@biomejs/cli-darwin-x64@1.8.1': {} - '@biomejs/cli-linux-arm64-musl@1.8.0': + '@biomejs/cli-linux-arm64-musl@1.8.1': optional: true - '@biomejs/cli-linux-arm64@1.8.0': {} + '@biomejs/cli-linux-arm64@1.8.1': {} - '@biomejs/cli-linux-x64-musl@1.8.0': + '@biomejs/cli-linux-x64-musl@1.8.1': optional: true - '@biomejs/cli-linux-x64@1.8.0': {} + '@biomejs/cli-linux-x64@1.8.1': {} - '@biomejs/cli-win32-arm64@1.8.0': + '@biomejs/cli-win32-arm64@1.8.1': optional: true - '@biomejs/cli-win32-x64@1.8.0': + '@biomejs/cli-win32-x64@1.8.1': optional: true '@bull-board/api@5.20.1(@bull-board/ui@5.20.1)': From 1accf4863bdbeafbeab0990f0e135412b2938f3f Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 10 Jun 2024 20:06:51 +0000 Subject: [PATCH 02/10] chore(deps): update pnpm to v9.3.0 --- package.json | 4 ++-- pnpm-lock.yaml | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f2c7938d35..2cab6af466 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://firefish.dev/firefish/firefish.git" }, - "packageManager": "pnpm@9.2.0", + "packageManager": "pnpm@9.3.0", "private": true, "scripts": { "rebuild": "pnpm run clean && pnpm run build", @@ -48,7 +48,7 @@ "@biomejs/cli-linux-x64": "1.8.0", "@types/node": "20.14.2", "execa": "9.2.0", - "pnpm": "9.2.0", + "pnpm": "9.3.0", "typescript": "5.4.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7629a96c0f..61373b272a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,8 +34,8 @@ importers: specifier: 9.2.0 version: 9.2.0 pnpm: - specifier: 9.2.0 - version: 9.2.0 + specifier: 9.3.0 + version: 9.3.0 typescript: specifier: 5.4.5 version: 5.4.5 @@ -1518,6 +1518,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1525,6 +1526,7 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@humanwhocodes/retry@0.3.0': resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} @@ -6426,8 +6428,8 @@ packages: resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} engines: {node: '>=14.19.0'} - pnpm@9.2.0: - resolution: {integrity: sha512-mKgP0RwucJZ0d2IwQQZDKz3cZ9z1S1qMAck/aKLNXgXmghhJUioG+3YoTUGiZg1eM08u47vykYO/LnObHa+ncQ==} + pnpm@9.3.0: + resolution: {integrity: sha512-7nuT4MK9EUCcZCT5K4ZvMdPqG+9fvkfTx1AM3DyWaIM9LlVoGtZt9bZAxh+p3CXVRu+lTXbX+L9UsTYUrCk2MQ==} engines: {node: '>=18.12'} hasBin: true @@ -14564,7 +14566,7 @@ snapshots: pngjs@7.0.0: {} - pnpm@9.2.0: {} + pnpm@9.3.0: {} possible-typed-array-names@1.0.0: {} From e4be03da7278a26c7c0506c24c729797c52b5574 Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 10 Jun 2024 20:07:18 +0000 Subject: [PATCH 03/10] fix(deps): update dependency aws-sdk to v2.1638.0 --- packages/backend/package.json | 2 +- pnpm-lock.yaml | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index db9d170640..85944e1158 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -36,7 +36,7 @@ "adm-zip": "0.5.14", "ajv": "8.16.0", "archiver": "7.0.1", - "aws-sdk": "2.1637.0", + "aws-sdk": "2.1638.0", "axios": "1.7.2", "backend-rs": "workspace:*", "blurhash": "2.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7629a96c0f..bce82b306f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,8 +85,8 @@ importers: specifier: 7.0.1 version: 7.0.1 aws-sdk: - specifier: 2.1637.0 - version: 2.1637.0 + specifier: 2.1638.0 + version: 2.1638.0 axios: specifier: 1.7.2 version: 1.7.2 @@ -1518,6 +1518,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -1525,6 +1526,7 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@humanwhocodes/retry@0.3.0': resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} @@ -3038,8 +3040,8 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - aws-sdk@2.1637.0: - resolution: {integrity: sha512-oV5I/d9Bd9ktXPsHOOKaJy5R5ynN3XtxCzYn30xjTnkWmZx1QKD1BGmBGJR/DigdeNWvnuGWOSPh4KGkp6Jgag==} + aws-sdk@2.1638.0: + resolution: {integrity: sha512-/Li+eOMvJOLuYXimt3YPd6ec9Xvzh6L5KLfU5bjuJrltQqBcW7paL+PnFqSjm7zef+fPJT7h+8sqEcuRaGUmRA==} engines: {node: '>= 10.0.0'} axios@0.24.0: @@ -10510,7 +10512,7 @@ snapshots: dependencies: possible-typed-array-names: 1.0.0 - aws-sdk@2.1637.0: + aws-sdk@2.1638.0: dependencies: buffer: 4.9.2 events: 1.1.1 From 4946faa03202481dd147585a37096a9af227c78d Mon Sep 17 00:00:00 2001 From: CI Date: Mon, 10 Jun 2024 20:07:35 +0000 Subject: [PATCH 04/10] chore(deps): update rust crate idna to v1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index de00661349..e26001dad4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ chrono = { version = "0.4.38", default-features = false } convert_case = { version = "0.6.0", default-features = false } cuid2 = { version = "0.1.2", default-features = false } emojis = { version = "0.6.2", default-features = false } -idna = { version = "0.5.0", default-features = false } +idna = { version = "1.0.0", default-features = false } image = { version = "0.25.1", default-features = false } isahc = { version = "1.7.2", default-features = false } nom-exif = { version = "1.2.0", default-features = false } From 8a7ccbe72dd5a15d1841d0c8b740bcc2181997c1 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 11 Jun 2024 10:23:21 +0900 Subject: [PATCH 05/10] chore (backend-rs): add idna feature flags --- Cargo.lock | 271 ++++++++++++++++++++++++++++++++- packages/backend-rs/Cargo.toml | 2 +- 2 files changed, 269 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44cf837769..9bd7f54a8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ "chrono", "cuid2", "emojis", - "idna", + "idna 1.0.0", "image", "isahc", "macro-rs", @@ -723,7 +723,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -765,6 +765,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -1263,6 +1274,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "idna" version = "0.5.0" @@ -1273,6 +1402,18 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + [[package]] name = "image" version = "0.25.1" @@ -1555,6 +1696,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -3210,6 +3357,12 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3273,6 +3426,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "sysinfo" version = "0.30.12" @@ -3389,6 +3553,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3628,7 +3802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", ] @@ -3638,6 +3812,18 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" version = "1.8.0" @@ -3989,12 +4175,48 @@ dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "yansi" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -4015,12 +4237,55 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "synstructure 0.13.1", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "zune-core" version = "0.4.12" diff --git a/packages/backend-rs/Cargo.toml b/packages/backend-rs/Cargo.toml index 8dd935c1a0..996a95bce4 100644 --- a/packages/backend-rs/Cargo.toml +++ b/packages/backend-rs/Cargo.toml @@ -25,7 +25,7 @@ bcrypt = { workspace = true, features = ["std"] } chrono = { workspace = true } cuid2 = { workspace = true } emojis = { workspace = true } -idna = { workspace = true } +idna = { workspace = true, features = ["std", "compiled_data"] } image = { workspace = true, features = ["avif", "bmp", "gif", "ico", "jpeg", "png", "tiff", "webp"] } isahc = { workspace = true, features = ["http2", "text-decoding"] } nom-exif = { workspace = true } From e0733d206b183919898ee28633930d5b23143db9 Mon Sep 17 00:00:00 2001 From: CI Date: Tue, 11 Jun 2024 04:06:10 +0000 Subject: [PATCH 06/10] chore(deps): update rust crate url to 2.5.1 --- Cargo.lock | 18 ++++-------------- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bd7f54a8c..ed33db8d3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ "chrono", "cuid2", "emojis", - "idna 1.0.0", + "idna", "image", "isahc", "macro-rs", @@ -1392,16 +1392,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.0" @@ -3797,12 +3787,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] diff --git a/Cargo.toml b/Cargo.toml index e26001dad4..0e3536a5b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tokio = { version = "1.38.0", default-features = false } tokio-test = { version = "0.4.4", default-features = false } tracing = { version = "0.1.40", default-features = false } tracing-subscriber = { version = "0.3.18", default-features = false } -url = { version = "2.5.0", default-features = false } +url = { version = "2.5.1", default-features = false } urlencoding = { version = "2.1.3", default-features = false } web-push = { git = "https://github.com/pimeys/rust-web-push.git", rev = "40febe4085e3cef9cdfd539c315e3e945aba0656", default-features = false } From 301d97f7fee0a36a505e4e2e9ebcc331f44239d2 Mon Sep 17 00:00:00 2001 From: CI Date: Tue, 11 Jun 2024 04:07:00 +0000 Subject: [PATCH 07/10] chore(deps): lock file maintenance --- Cargo.lock | 30 ++++------ pnpm-lock.yaml | 150 +++++++++++++++++++++++++------------------------ 2 files changed, 86 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bd7f54a8c..75db34e287 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ "chrono", "cuid2", "emojis", - "idna 1.0.0", + "idna", "image", "isahc", "macro-rs", @@ -411,9 +411,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", @@ -1392,16 +1392,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.0" @@ -2629,9 +2619,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -2640,9 +2630,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rfc6979" @@ -3797,12 +3787,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22f08fb5dc..70e9bf2d3e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1939,33 +1939,33 @@ packages: resolution: {integrity: sha512-sTGoeZnjI8N4KS+sW2AN95gDBErhAguvkw/tWdCjeM8bvxpz5lqrnd0vOJABA1A+Ic3zED7PYoLP/RANLgVotA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2': - resolution: {integrity: sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==} + '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3': + resolution: {integrity: sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==} cpu: [arm64] os: [darwin] - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.2': - resolution: {integrity: sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==} + '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3': + resolution: {integrity: sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==} cpu: [x64] os: [darwin] - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2': - resolution: {integrity: sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==} + '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.3': + resolution: {integrity: sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==} cpu: [arm64] os: [linux] - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.2': - resolution: {integrity: sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==} + '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.3': + resolution: {integrity: sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==} cpu: [arm] os: [linux] - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.2': - resolution: {integrity: sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==} + '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.3': + resolution: {integrity: sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==} cpu: [x64] os: [linux] - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.2': - resolution: {integrity: sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==} + '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': + resolution: {integrity: sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==} cpu: [x64] os: [win32] @@ -2683,8 +2683,8 @@ packages: resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} engines: {node: ^16.0.0 || >=18.0.0} - '@typescript-eslint/types@7.12.0': - resolution: {integrity: sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==} + '@typescript-eslint/types@7.13.0': + resolution: {integrity: sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA==} engines: {node: ^18.18.0 || >=20.0.0} '@typescript-eslint/typescript-estree@5.62.0': @@ -2735,14 +2735,14 @@ packages: vite: ^5.0.0 vue: ^3.2.25 - '@volar/language-core@2.3.0-alpha.15': - resolution: {integrity: sha512-uSfn1Dsl1w9o2aN9nnS6N/4FcjSbmpY6P/ypfW4kRhasEyICstu4swIz2joNR6532R02JwJY9Ta0pxRmXbBOqw==} + '@volar/language-core@2.3.0': + resolution: {integrity: sha512-pvhL24WUh3VDnv7Yw5N1sjhPtdx7q9g+Wl3tggmnkMcyK8GcCNElF2zHiKznryn0DiUGk+eez/p2qQhz+puuHw==} - '@volar/source-map@2.3.0-alpha.15': - resolution: {integrity: sha512-DQr3FwhRxtxX4W6BoJkwajWjj6BAF5H/SgtzFaUP9z8txn6Y5oFxZPPDG+3Xwu3pTV3gvVlE7AL5E/G1jUr5Yg==} + '@volar/source-map@2.3.0': + resolution: {integrity: sha512-G/228aZjAOGhDjhlyZ++nDbKrS9uk+5DMaEstjvzglaAw7nqtDyhnQAsYzUg6BMP9BtwZ59RIw5HGePrutn00Q==} - '@volar/typescript@2.3.0-alpha.15': - resolution: {integrity: sha512-sTzUyqGC1wkzVyY0XZBO5smCPDRvIqxlMTUw7bZebuD/7sGaVfyk9ryE29aG6CLpuYDev/ugpQsKoFVhFaQQ8A==} + '@volar/typescript@2.3.0': + resolution: {integrity: sha512-PtUwMM87WsKVeLJN33GSTUjBexlKfKgouWlOUIv7pjrOnTwhXHZNSmpc312xgXdTjQPpToK6KXSIcKu9sBQ5LQ==} '@vue/compiler-core@3.4.27': resolution: {integrity: sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==} @@ -3150,8 +3150,8 @@ packages: browserify-zlib@0.1.4: resolution: {integrity: sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==} - browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} + browserslist@4.23.1: + resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3258,8 +3258,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001629: - resolution: {integrity: sha512-c3dl911slnQhmxUIT4HhYzT7wnBK/XYpGnYLOj4nJBaRiw52Ibe7YxlDaAeRECvA786zCuExhxIUJ2K7nHMrBw==} + caniuse-lite@1.0.30001632: + resolution: {integrity: sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg==} canonicalize@1.0.8: resolution: {integrity: sha512-0CNTVCLZggSh7bc5VkX5WWPWO+cyZbNd07IHIsSXLia/eAq+r836hgk+8BKoEh7949Mda87VUOitx5OddVj64A==} @@ -4018,8 +4018,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.4.794: - resolution: {integrity: sha512-6FApLtsYhDCY0Vglq3AptsdxQ+PJLc6AxlAM0HjEihUAiOPPbkASEsq9gtxUeZY9o0sJIEa3WnF0vVH4VT4iug==} + electron-to-chromium@1.4.798: + resolution: {integrity: sha512-by9J2CiM9KPGj9qfp5U4FcPSbXJG7FNzqnYaY4WLzX+v2PHieVGmnsA4dxfpGE3QEC7JofpPZmn7Vn1B9NR2+Q==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -5966,8 +5966,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msgpackr-extract@3.0.2: - resolution: {integrity: sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==} + msgpackr-extract@3.0.3: + resolution: {integrity: sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==} hasBin: true msgpackr@1.10.2: @@ -6040,14 +6040,14 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-gyp-build-optional-packages@5.0.7: - resolution: {integrity: sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==} - hasBin: true - node-gyp-build-optional-packages@5.1.1: resolution: {integrity: sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw==} hasBin: true + node-gyp-build-optional-packages@5.2.2: + resolution: {integrity: sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==} + hasBin: true + node-gyp-build@4.8.1: resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} hasBin: true @@ -8004,8 +8004,8 @@ packages: resolution: {integrity: sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==} engines: {node: ^14.17.0 || >=16.0.0} - yaml@2.4.3: - resolution: {integrity: sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==} + yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} hasBin: true @@ -8123,7 +8123,7 @@ snapshots: dependencies: '@babel/compat-data': 7.24.7 '@babel/helper-validator-option': 7.24.7 - browserslist: 4.23.0 + browserslist: 4.23.1 lru-cache: 5.1.1 semver: 6.3.1 @@ -8536,7 +8536,7 @@ snapshots: dependencies: '@types/eslint': 8.56.10 '@types/estree': 1.0.5 - '@typescript-eslint/types': 7.12.0 + '@typescript-eslint/types': 7.13.0 comment-parser: 1.4.1 esquery: 1.5.0 jsdoc-type-pratt-parser: 4.0.0 @@ -9256,22 +9256,22 @@ snapshots: got: 11.8.6 os-filter-obj: 2.0.0 - '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2': + '@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3': optional: true - '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.2': + '@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3': optional: true - '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.2': + '@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.3': optional: true - '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.2': + '@msgpackr-extract/msgpackr-extract-linux-arm@3.0.3': optional: true - '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.2': + '@msgpackr-extract/msgpackr-extract-linux-x64@3.0.3': optional: true - '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.2': + '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true '@napi-rs/cli@2.18.3': {} @@ -10035,7 +10035,7 @@ snapshots: '@typescript-eslint/types@6.21.0': {} - '@typescript-eslint/types@7.12.0': {} + '@typescript-eslint/types@7.13.0': {} '@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.4)': dependencies: @@ -10141,17 +10141,17 @@ snapshots: vite: 5.2.13(@types/node@20.14.2)(sass@1.77.4)(stylus@0.57.0)(terser@5.31.1) vue: 3.4.27(typescript@5.4.5) - '@volar/language-core@2.3.0-alpha.15': + '@volar/language-core@2.3.0': dependencies: - '@volar/source-map': 2.3.0-alpha.15 + '@volar/source-map': 2.3.0 - '@volar/source-map@2.3.0-alpha.15': + '@volar/source-map@2.3.0': dependencies: muggle-string: 0.4.1 - '@volar/typescript@2.3.0-alpha.15': + '@volar/typescript@2.3.0': dependencies: - '@volar/language-core': 2.3.0-alpha.15 + '@volar/language-core': 2.3.0 path-browserify: 1.0.1 vscode-uri: 3.0.8 @@ -10195,7 +10195,7 @@ snapshots: '@vue/language-core@2.0.21(typescript@5.4.5)': dependencies: - '@volar/language-core': 2.3.0-alpha.15 + '@volar/language-core': 2.3.0 '@vue/compiler-dom': 3.4.27 '@vue/shared': 3.4.27 computeds: 0.0.1 @@ -10679,12 +10679,12 @@ snapshots: dependencies: pako: 0.2.9 - browserslist@4.23.0: + browserslist@4.23.1: dependencies: - caniuse-lite: 1.0.30001629 - electron-to-chromium: 1.4.794 + caniuse-lite: 1.0.30001632 + electron-to-chromium: 1.4.798 node-releases: 2.0.14 - update-browserslist-db: 1.0.16(browserslist@4.23.0) + update-browserslist-db: 1.0.16(browserslist@4.23.1) bs-logger@0.2.6: dependencies: @@ -10712,7 +10712,7 @@ snapshots: buffer@4.9.2: dependencies: base64-js: 1.5.1 - ieee754: 1.2.1 + ieee754: 1.1.13 isarray: 1.0.0 buffer@5.7.1: @@ -10804,7 +10804,7 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001629: {} + caniuse-lite@1.0.30001632: {} canonicalize@1.0.8: {} @@ -11466,7 +11466,7 @@ snapshots: dependencies: jake: 10.9.1 - electron-to-chromium@1.4.794: {} + electron-to-chromium@1.4.798: {} emittery@0.13.1: {} @@ -14123,21 +14123,21 @@ snapshots: ms@2.1.3: {} - msgpackr-extract@3.0.2: + msgpackr-extract@3.0.3: dependencies: - node-gyp-build-optional-packages: 5.0.7 + node-gyp-build-optional-packages: 5.2.2 optionalDependencies: - '@msgpackr-extract/msgpackr-extract-darwin-arm64': 3.0.2 - '@msgpackr-extract/msgpackr-extract-darwin-x64': 3.0.2 - '@msgpackr-extract/msgpackr-extract-linux-arm': 3.0.2 - '@msgpackr-extract/msgpackr-extract-linux-arm64': 3.0.2 - '@msgpackr-extract/msgpackr-extract-linux-x64': 3.0.2 - '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.2 + '@msgpackr-extract/msgpackr-extract-darwin-arm64': 3.0.3 + '@msgpackr-extract/msgpackr-extract-darwin-x64': 3.0.3 + '@msgpackr-extract/msgpackr-extract-linux-arm': 3.0.3 + '@msgpackr-extract/msgpackr-extract-linux-arm64': 3.0.3 + '@msgpackr-extract/msgpackr-extract-linux-x64': 3.0.3 + '@msgpackr-extract/msgpackr-extract-win32-x64': 3.0.3 optional: true msgpackr@1.10.2: optionalDependencies: - msgpackr-extract: 3.0.2 + msgpackr-extract: 3.0.3 muggle-string@0.4.1: {} @@ -14202,10 +14202,12 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - node-gyp-build-optional-packages@5.0.7: + node-gyp-build-optional-packages@5.1.1: + dependencies: + detect-libc: 2.0.3 optional: true - node-gyp-build-optional-packages@5.1.1: + node-gyp-build-optional-packages@5.2.2: dependencies: detect-libc: 2.0.3 optional: true @@ -15872,9 +15874,9 @@ snapshots: unpipe@1.0.0: {} - update-browserslist-db@1.0.16(browserslist@4.23.0): + update-browserslist-db@1.0.16(browserslist@4.23.1): dependencies: - browserslist: 4.23.0 + browserslist: 4.23.1 escalade: 3.1.2 picocolors: 1.0.1 @@ -15999,7 +16001,7 @@ snapshots: vue-tsc@2.0.21(typescript@5.4.5): dependencies: - '@volar/typescript': 2.3.0-alpha.15 + '@volar/typescript': 2.3.0 '@vue/language-core': 2.0.21(typescript@5.4.5) semver: 7.6.2 typescript: 5.4.5 @@ -16055,7 +16057,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.11.3 acorn-import-assertions: 1.9.0(acorn@8.11.3) - browserslist: 4.23.0 + browserslist: 4.23.1 chrome-trace-event: 1.0.4 enhanced-resolve: 5.17.0 es-module-lexer: 1.5.3 @@ -16193,7 +16195,7 @@ snapshots: xml2js@0.6.2: dependencies: - sax: 1.4.1 + sax: 1.2.1 xmlbuilder: 11.0.1 xmlbuilder@11.0.1: {} @@ -16220,9 +16222,9 @@ snapshots: dependencies: eslint-visitor-keys: 3.4.3 lodash: 4.17.21 - yaml: 2.4.3 + yaml: 2.4.5 - yaml@2.4.3: {} + yaml@2.4.5: {} yargs-parser@18.1.3: dependencies: From 9ec9c31ab57179cda4c2bdf25d881fa49c5196b7 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 11 Jun 2024 18:15:36 +0900 Subject: [PATCH 08/10] ci: update renovate config (add package groups) --- renovate.json | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/renovate.json b/renovate.json index a0650daff1..6b4dcefd08 100644 --- a/renovate.json +++ b/renovate.json @@ -10,16 +10,30 @@ "ignorePaths": ["packages/megalodon/package.json", "packages/backend-rs/npm"], "lockFileMaintenance": { "enabled": true, - "automerge": true, "recreateWhen": "always", "rebaseWhen": "behind-base-branch", "branchTopic": "lock-file-maintenance", "commitMessageAction": "Lock file maintenance" }, "packageRules": [ - {"matchUpdateTypes": "patch", "automerge": true}, - {"groupName": "definitelyTyped", "matchPackagePrefixes": ["@types/"]}, - {"groupName": "bull-board", "matchPackagePrefixes": ["@bull-board/"]}, - {"groupName": "biome", "matchPackagePrefixes": ["@biomejs/"]} + {"matchUpdateTypes": ["patch", "lockFileMaintenance"], "automerge": true}, + {"groupName": "rust-url", "matchManagers": ["cargo"], "matchPackageNames": ["idna", "url"]}, + {"groupName": "definitelyTyped", "matchManagers": ["npm"], "matchPackagePrefixes": ["@types/"]}, + {"groupName": "bull-board", "matchManagers": ["npm"], "matchPackagePrefixes": ["@bull-board/"]}, + {"groupName": "biome", "matchManagers": ["npm"], "matchPackagePrefixes": ["@biomejs/"]}, + { + "groupName": "Misskey dependencies", + "matchManagers": ["npm"], + "matchPackageNames": [ + "@misskey-dev/browser-image-resizer", + "@syuilo/aiscript", + "mfm-js", + "rndstr", + "summaly", + "syuilo-password-strength", + "xev" + ], + "automerge": false + } ] } From 1cc24b9c25fa4c3c51ff4e2fcdabeb19068b39e3 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 11 Jun 2024 19:09:44 +0900 Subject: [PATCH 09/10] feature (backend-rs, macro-rs): prittify error outputs for napi export Co-authored-by: sup39 --- packages/backend-rs/src/util/error_chain.rs | 90 +++++++++++++++++++++ packages/backend-rs/src/util/mod.rs | 1 + packages/macro-rs/src/lib.rs | 10 +-- 3 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 packages/backend-rs/src/util/error_chain.rs diff --git a/packages/backend-rs/src/util/error_chain.rs b/packages/backend-rs/src/util/error_chain.rs new file mode 100644 index 0000000000..086e5449f2 --- /dev/null +++ b/packages/backend-rs/src/util/error_chain.rs @@ -0,0 +1,90 @@ +//! Error formatter used until backtracing methods are standarized + +use std::error::Error; + +/// Prettifies [`Error`] message (mainly for napi export) +pub fn format_error(mut error: &dyn Error) -> String { + let mut to_return = String::new(); + + to_return.push_str(&format!( + concat!(" raw: {0:?}", "\n", " message: {0}"), + error, + )); + + while let Some(source) = error.source() { + to_return.push('\n'); + to_return.push_str(&format!("caused by: {}", source)); + error = source; + } + + to_return +} + +#[cfg(test)] +mod unit_test { + use pretty_assertions::assert_eq; + + #[test] + fn format_error() { + #[derive(thiserror::Error, Debug)] + #[error("inner error 1")] + struct InnerError1; + + #[derive(thiserror::Error, Debug)] + #[error("unexpected string '{0}'")] + struct InnerError2(String); + + #[derive(thiserror::Error, Debug)] + enum ErrorVariants { + #[error("error 1 occured")] + Error1(#[from] InnerError1), + #[error("error 2 occured")] + Error2(#[from] InnerError2), + } + + fn causes_inner_error_1() -> Result<(), InnerError1> { + Err(InnerError1) + } + fn causes_inner_error_2() -> Result<(), InnerError2> { + Err(InnerError2("foo".to_string())) + } + + fn causes_error_1() -> Result<(), ErrorVariants> { + causes_inner_error_1()?; + Ok(()) + } + fn causes_error_2() -> Result<(), ErrorVariants> { + causes_inner_error_2()?; + Ok(()) + } + + let error_1 = causes_error_1().unwrap_err(); + let error_2 = causes_error_2().unwrap_err(); + + let error_message_1 = super::format_error(&error_1); + let error_message_2 = super::format_error(&error_2); + + // We can't assume consistency in `Debug` output, so the output texts + // may need to be updated in the future, and we shouldn't make this kind + // of assumption in the actual program. + let expected_message_1 = " + raw: Error1(InnerError1) + message: error 1 occured +caused by: inner error 1 +"; + let expected_message_2 = r#" + raw: Error2(InnerError2("foo")) + message: error 2 occured +caused by: unexpected string 'foo' +"#; + + assert_eq!( + error_message_1, + expected_message_1[1..expected_message_1.len() - 1] + ); + assert_eq!( + error_message_2, + expected_message_2[1..expected_message_2.len() - 1] + ); + } +} diff --git a/packages/backend-rs/src/util/mod.rs b/packages/backend-rs/src/util/mod.rs index 761527c4ae..3df33831e8 100644 --- a/packages/backend-rs/src/util/mod.rs +++ b/packages/backend-rs/src/util/mod.rs @@ -1,5 +1,6 @@ //! Basic utilities such as ID generator and HTTP client +pub mod error_chain; pub mod http_client; pub mod id; pub mod random; diff --git a/packages/macro-rs/src/lib.rs b/packages/macro-rs/src/lib.rs index eebbe198cc..65ad817e05 100644 --- a/packages/macro-rs/src/lib.rs +++ b/packages/macro-rs/src/lib.rs @@ -212,7 +212,7 @@ pub fn ts_export( /// ``` /// /// ## Function with `Result` return type -/// ``` +/// ```ignore /// #[derive(thiserror::Error, Debug)] /// pub enum IntegerDivisionError { /// #[error("Divided by zero")] @@ -233,7 +233,7 @@ pub fn ts_export( /// } /// ``` /// generates -/// ``` +/// ```ignore /// # #[derive(thiserror::Error, Debug)] /// # pub enum IntegerDivisionError { /// # #[error("Divided by zero")] @@ -252,7 +252,7 @@ pub fn ts_export( /// # } /// #[napi_derive::napi(js_name = "integerDivide",)] /// pub fn integer_divide_napi(dividend: i64, divisor: i64) -> napi::Result { -/// integer_divide(dividend, divisor).map_err(|err| napi::Error::from_reason(err.to_string())) +/// integer_divide(dividend, divisor).map_err(|err| napi::Error::from_reason(crate::util::error_chain::format_error(&err))) /// } /// ``` #[proc_macro_attribute] @@ -329,7 +329,7 @@ fn napi_impl(macro_attr: TokenStream, item: TokenStream) -> TokenStream { }; // add modifier to function call result function_call_modifiers.push(quote! { - .map_err(|err| napi::Error::from_reason(err.to_string())) + .map_err(|err| napi::Error::from_reason(crate::util::error_chain::format_error(&err))) }); } }; @@ -539,7 +539,7 @@ mod tests { divisor: i64, ) -> napi::Result { integer_divide(dividend, divisor) - .map_err(|err| napi::Error::from_reason(err.to_string())) + .map_err(|err| napi::Error::from_reason(crate::util::error_chain::format_error(&err))) } } ); From 9e6e7733a3856df034765f69f65a5a75fe49996e Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 11 Jun 2024 19:49:44 +0900 Subject: [PATCH 10/10] chore (backend-rs): improve error messages refs: https://rust-lang.github.io/api-guidelines/interoperability.html https://github.com/rust-lang/project-error-handling/issues/27 --- packages/backend-rs/src/database/cache.rs | 6 ++-- packages/backend-rs/src/database/redis.rs | 4 +-- packages/backend-rs/src/federation/acct.rs | 1 + .../src/federation/nodeinfo/fetch.rs | 13 +++++---- .../src/federation/nodeinfo/generate.rs | 5 ++-- packages/backend-rs/src/misc/convert_host.rs | 7 +++-- .../backend-rs/src/misc/get_image_size.rs | 29 ++++++++++++------- .../backend-rs/src/misc/latest_version.rs | 19 ++++++------ packages/backend-rs/src/misc/password.rs | 8 ++--- packages/backend-rs/src/misc/reaction.rs | 5 ++-- .../src/service/antenna/check_hit.rs | 5 ++-- .../src/service/antenna/process_new_note.rs | 16 +++++----- .../src/service/push_notification.rs | 12 ++++---- packages/backend-rs/src/service/stream.rs | 12 ++++---- packages/backend-rs/src/util/http_client.rs | 4 +-- packages/backend-rs/src/util/id.rs | 3 +- 16 files changed, 83 insertions(+), 66 deletions(-) diff --git a/packages/backend-rs/src/database/cache.rs b/packages/backend-rs/src/database/cache.rs index c49806afdf..1dcd81d9ec 100644 --- a/packages/backend-rs/src/database/cache.rs +++ b/packages/backend-rs/src/database/cache.rs @@ -15,11 +15,11 @@ pub enum Category { #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Redis error: {0}")] + #[error("failed to execute Redis command")] Redis(#[from] RedisError), - #[error("Redis connection error: {0}")] + #[error("bad Redis connection")] RedisConn(#[from] RedisConnError), - #[error("Failed to encode the data: {0}")] + #[error("failed to encode data for Redis")] Encode(#[from] rmp_serde::encode::Error), } diff --git a/packages/backend-rs/src/database/redis.rs b/packages/backend-rs/src/database/redis.rs index f40cd011c2..3207e5cbbd 100644 --- a/packages/backend-rs/src/database/redis.rs +++ b/packages/backend-rs/src/database/redis.rs @@ -81,9 +81,9 @@ async fn init_conn_pool() -> Result<(), RedisError> { #[derive(thiserror::Error, Debug)] pub enum RedisConnError { - #[error("Failed to initialize Redis connection pool: {0}")] + #[error("failed to initialize Redis connection pool")] Redis(RedisError), - #[error("Redis connection pool error: {0}")] + #[error("bad Redis connection pool")] Bb8Pool(RunError), } diff --git a/packages/backend-rs/src/federation/acct.rs b/packages/backend-rs/src/federation/acct.rs index ffc972ba84..b07cb71448 100644 --- a/packages/backend-rs/src/federation/acct.rs +++ b/packages/backend-rs/src/federation/acct.rs @@ -8,6 +8,7 @@ pub struct Acct { } #[derive(thiserror::Error, Debug)] +#[doc = "Error type to indicate a string-to-[`Acct`] conversion failure"] #[error("failed to convert string '{0}' into acct")] pub struct InvalidAcctString(String); diff --git a/packages/backend-rs/src/federation/nodeinfo/fetch.rs b/packages/backend-rs/src/federation/nodeinfo/fetch.rs index 1b963e086c..89a325e597 100644 --- a/packages/backend-rs/src/federation/nodeinfo/fetch.rs +++ b/packages/backend-rs/src/federation/nodeinfo/fetch.rs @@ -9,17 +9,18 @@ use serde::Deserialize; /// Errors that can occur while fetching NodeInfo from a remote server #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("HTTP client aquisition error: {0}")] + #[error("failed to acquire an HTTP client")] HttpClient(#[from] http_client::Error), - #[error("HTTP error: {0}")] + #[error("HTTP request failed")] Http(#[from] isahc::Error), - #[error("Bad status: {0}")] + #[doc = "bad HTTP status"] + #[error("bad HTTP status ({0})")] BadStatus(String), - #[error("Failed to parse response body as text: {0}")] + #[error("failed to parse HTTP response body as text")] Response(#[from] std::io::Error), - #[error("Failed to parse response body as json: {0}")] + #[error("failed to parse HTTP response body as json")] Json(#[from] serde_json::Error), - #[error("No nodeinfo provided")] + #[error("nodeinfo is missing")] MissingNodeinfo, } diff --git a/packages/backend-rs/src/federation/nodeinfo/generate.rs b/packages/backend-rs/src/federation/nodeinfo/generate.rs index e83fb059b1..b37652637c 100644 --- a/packages/backend-rs/src/federation/nodeinfo/generate.rs +++ b/packages/backend-rs/src/federation/nodeinfo/generate.rs @@ -154,9 +154,10 @@ pub async fn nodeinfo_2_0() -> Result { #[cfg(feature = "napi")] #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Database error: {0}")] + #[doc = "database error"] + #[error(transparent)] Db(#[from] DbErr), - #[error("Failed to serialize nodeinfo into JSON: {0}")] + #[error("failed to serialize nodeinfo into JSON")] Json(#[from] serde_json::Error), } diff --git a/packages/backend-rs/src/misc/convert_host.rs b/packages/backend-rs/src/misc/convert_host.rs index c086285af1..2850d4cb29 100644 --- a/packages/backend-rs/src/misc/convert_host.rs +++ b/packages/backend-rs/src/misc/convert_host.rs @@ -4,11 +4,12 @@ #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Idna error: {0}")] + #[doc = "UTS #46 process has failed"] + #[error(transparent)] Idna(#[from] idna::Errors), - #[error("Url parse error: {0}")] + #[error("failed to parse a URL")] UrlParse(#[from] url::ParseError), - #[error("Hostname is missing")] + #[error("hostname is missing")] NoHostname, } diff --git a/packages/backend-rs/src/misc/get_image_size.rs b/packages/backend-rs/src/misc/get_image_size.rs index 78c40cf5a1..31d5bb398f 100644 --- a/packages/backend-rs/src/misc/get_image_size.rs +++ b/packages/backend-rs/src/misc/get_image_size.rs @@ -7,23 +7,26 @@ use tokio::sync::Mutex; #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Redis cache error: {0}")] + #[error("Redis cache operation has failed")] Cache(#[from] cache::Error), - #[error("HTTP client aquisition error: {0}")] + #[error("failed to acquire an HTTP client")] HttpClient(#[from] http_client::Error), - #[error("Isahc error: {0}")] + #[error("HTTP request failed")] Isahc(#[from] isahc::Error), - #[error("HTTP error: {0}")] - Http(String), - #[error("Image decoding error: {0}")] + #[doc = "bad HTTP status"] + #[error("bad HTTP status ({0})")] + BadStatus(String), + #[error("failed to decode an image")] Image(#[from] ImageError), - #[error("Image decoding error: {0}")] + #[error("failed to decode an image")] Io(#[from] std::io::Error), - #[error("Exif extraction error: {0}")] + #[error("failed to extract the exif data")] Exif(#[from] nom_exif::Error), - #[error("Emoji meta attempt limit exceeded: {0}")] + #[doc = "too many fetch attempts"] + #[error("too many fetch attempts for {0}")] TooManyAttempts(String), - #[error("Unsupported image type: {0}")] + #[doc = "unsupported image type"] + #[error("unsupported image type ({0})")] UnsupportedImage(String), } @@ -75,7 +78,11 @@ pub async fn get_image_size_from_url(url: &str) -> Result { if !response.status().is_success() { tracing::info!("status: {}", response.status()); tracing::debug!("response body: {:#?}", response.body()); - return Err(Error::Http(format!("Failed to get image from {}", url))); + return Err(Error::BadStatus(format!( + "{} returned {}", + url, + response.status() + ))); } let image_bytes = response.bytes().await?; diff --git a/packages/backend-rs/src/misc/latest_version.rs b/packages/backend-rs/src/misc/latest_version.rs index f6453249b8..ad1d6b2fc7 100644 --- a/packages/backend-rs/src/misc/latest_version.rs +++ b/packages/backend-rs/src/misc/latest_version.rs @@ -6,17 +6,18 @@ use serde::Deserialize; #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Cache error: {0}")] + #[error("Redis cache operation has failed")] Cache(#[from] cache::Error), - #[error("Isahc error: {0}")] + #[error("HTTP request failed")] Isahc(#[from] isahc::Error), - #[error("HTTP client aquisition error: {0}")] + #[error("failed to acquire an HTTP client")] HttpClient(#[from] http_client::Error), - #[error("HTTP error: {0}")] - Http(String), - #[error("Response parsing error: {0}")] + #[doc = "firefish.dev returned bad HTTP status"] + #[error("firefish.dev returned bad HTTP status ({0})")] + BadStatus(String), + #[error("failed to parse the HTTP response")] Io(#[from] std::io::Error), - #[error("Failed to deserialize JSON: {0}")] + #[error("failed to parse the HTTP response as JSON")] Json(#[from] serde_json::Error), } @@ -36,9 +37,7 @@ async fn get_latest_version() -> Result { if !response.status().is_success() { tracing::info!("status: {}", response.status()); tracing::debug!("response body: {:#?}", response.body()); - return Err(Error::Http( - "Failed to fetch version from Firefish GitLab".to_string(), - )); + return Err(Error::BadStatus(response.status().to_string())); } let res_parsed: Response = serde_json::from_str(&response.text().await?)?; diff --git a/packages/backend-rs/src/misc/password.rs b/packages/backend-rs/src/misc/password.rs index df18efd5a3..b23b305e32 100644 --- a/packages/backend-rs/src/misc/password.rs +++ b/packages/backend-rs/src/misc/password.rs @@ -17,12 +17,12 @@ pub fn hash_password(password: &str) -> Result) -> HashMap #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Idna error: {0}")] + #[doc = "UTS #46 process has failed"] + #[error(transparent)] Idna(#[from] idna::Errors), - #[error("Database error: {0}")] + #[error(transparent)] Db(#[from] DbErr), } diff --git a/packages/backend-rs/src/service/antenna/check_hit.rs b/packages/backend-rs/src/service/antenna/check_hit.rs index fa9720f0cf..ed751e1a8c 100644 --- a/packages/backend-rs/src/service/antenna/check_hit.rs +++ b/packages/backend-rs/src/service/antenna/check_hit.rs @@ -8,9 +8,10 @@ use sea_orm::{prelude::*, QuerySelect}; #[derive(thiserror::Error, Debug)] pub enum AntennaCheckError { - #[error("Database error: {0}")] + #[doc = "database error"] + #[error(transparent)] Db(#[from] DbErr), - #[error("Cache error: {0}")] + #[error("Redis cache operation has failed")] Cache(#[from] cache::Error), } diff --git a/packages/backend-rs/src/service/antenna/process_new_note.rs b/packages/backend-rs/src/service/antenna/process_new_note.rs index a90ef11803..7e86fbd31f 100644 --- a/packages/backend-rs/src/service/antenna/process_new_note.rs +++ b/packages/backend-rs/src/service/antenna/process_new_note.rs @@ -15,19 +15,21 @@ use sea_orm::prelude::*; #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Database error: {0}")] + #[doc = "database error"] + #[error(transparent)] Db(#[from] DbErr), - #[error("Cache error: {0}")] + #[error("Redis cache operation has failed")] Cache(#[from] cache::Error), - #[error("Redis error: {0}")] + #[error("failed to execute a Redis command")] Redis(#[from] RedisError), - #[error("Redis connection error: {0}")] + #[error("bad Redis connection")] RedisConn(#[from] RedisConnError), - #[error("Invalid ID: {0}")] + #[doc = "provided string is not a valid Firefish ID"] + #[error(transparent)] InvalidId(#[from] InvalidIdError), - #[error("Stream error: {0}")] + #[error("Redis stream operation has failed")] Stream(#[from] stream::Error), - #[error("Failed to check if the note should be added to antenna: {0}")] + #[error("failed to check if the note should be added to antenna")] AntennaCheck(#[from] AntennaCheckError), } diff --git a/packages/backend-rs/src/service/push_notification.rs b/packages/backend-rs/src/service/push_notification.rs index ccd83bf689..8bde9987d3 100644 --- a/packages/backend-rs/src/service/push_notification.rs +++ b/packages/backend-rs/src/service/push_notification.rs @@ -9,15 +9,17 @@ use web_push::*; #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Database error: {0}")] + #[doc = "database error"] + #[error(transparent)] Db(#[from] DbErr), - #[error("Web Push error: {0}")] + #[error("web push has failed")] WebPush(#[from] WebPushError), - #[error("Failed to (de)serialize an object: {0}")] + #[error("failed to (de)serialize an object")] Serialize(#[from] serde_json::Error), - #[error("Invalid content: {0}")] + #[doc = "provided content is invalid"] + #[error("invalid content ({0})")] InvalidContent(String), - #[error("HTTP client aquisition error: {0}")] + #[error("failed to acquire an HTTP client")] HttpClient(#[from] http_client::Error), } diff --git a/packages/backend-rs/src/service/stream.rs b/packages/backend-rs/src/service/stream.rs index a028707d38..4a72fc7ec0 100644 --- a/packages/backend-rs/src/service/stream.rs +++ b/packages/backend-rs/src/service/stream.rs @@ -62,14 +62,14 @@ pub enum ChatEvent { #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Redis error: {0}")] + #[error("failed to execute a Redis command")] Redis(#[from] RedisError), - #[error("Redis connection error: {0}")] + #[error("bad Redis connection")] RedisConn(#[from] RedisConnError), - #[error("Json (de)serialization error: {0}")] + #[error("failed to (de)serialize object")] Json(#[from] serde_json::Error), - #[error("Value error: {0}")] - Value(String), + #[error("invalid content")] + InvalidContent, } pub async fn publish_to_stream( @@ -104,7 +104,7 @@ pub async fn publish_to_stream( value.unwrap_or_else(|| "null".to_string()), ) } else { - value.ok_or(Error::Value("Invalid streaming message".to_string()))? + value.ok_or(Error::InvalidContent)? }; redis_conn() diff --git a/packages/backend-rs/src/util/http_client.rs b/packages/backend-rs/src/util/http_client.rs index 167f5c0198..3b56d57c6e 100644 --- a/packages/backend-rs/src/util/http_client.rs +++ b/packages/backend-rs/src/util/http_client.rs @@ -7,9 +7,9 @@ use std::time::Duration; #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("Isahc error: {0}")] + #[error("HTTP request failed")] Isahc(#[from] isahc::Error), - #[error("Url parse error: {0}")] + #[error("invalid URL")] UrlParse(#[from] isahc::http::uri::InvalidUri), } diff --git a/packages/backend-rs/src/util/id.rs b/packages/backend-rs/src/util/id.rs index 26c0e24d11..f61454d9c3 100644 --- a/packages/backend-rs/src/util/id.rs +++ b/packages/backend-rs/src/util/id.rs @@ -46,7 +46,8 @@ fn create_id(datetime: &NaiveDateTime) -> String { } #[derive(thiserror::Error, Debug)] -#[error("Invalid ID: {id}")] +#[doc = "Error type to indicate invalid Firefish ID"] +#[error("'{id}' is not a valid Firefish ID")] pub struct InvalidIdError { id: String, }