From 4d4c4e73e6e92b6466d9f84d8cbbc703f35cebf5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 23:44:36 +0000 Subject: Bump rollup from 2.79.2 to 2.80.0 in /src/web Bumps [rollup](https://github.com/rollup/rollup) from 2.79.2 to 2.80.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/v2.80.0/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.79.2...v2.80.0) --- updated-dependencies: - dependency-name: rollup dependency-version: 2.80.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- src/web/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/web/package-lock.json b/src/web/package-lock.json index e3b4e90c..bebd7d58 100644 --- a/src/web/package-lock.json +++ b/src/web/package-lock.json @@ -18247,10 +18247,11 @@ } }, "node_modules/rollup": { - "version": "2.79.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", - "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", + "version": "2.80.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.80.0.tgz", + "integrity": "sha512-cIFJOD1DESzpjOBl763Kp1AH7UE/0fcdHe6rZXUdQ9c50uvgigvW97u3IcSeBwOkgqL/PXPBktBCh0KEu5L8XQ==", "dev": true, + "license": "MIT", "bin": { "rollup": "dist/bin/rollup" }, -- cgit v1.2.3 From d2b41c3c95f15e3ded327ab3a99eb770322ae8b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 02:13:19 +0000 Subject: Bump minimatch and eslint-config-canonical in /src/web Bumps [minimatch](https://github.com/isaacs/minimatch) to 3.1.5 and updates ancestor dependencies [minimatch](https://github.com/isaacs/minimatch) and [eslint-config-canonical](https://github.com/gajus/eslint-config-canonical). These dependencies need to be updated together. Updates `minimatch` from 3.1.2 to 3.1.5 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5) Updates `minimatch` from 5.1.6 to 5.1.9 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5) Updates `eslint-config-canonical` from 42.8.1 to 42.8.3 - [Release notes](https://github.com/gajus/eslint-config-canonical/releases) - [Commits](https://github.com/gajus/eslint-config-canonical/compare/v42.8.1...v42.8.3) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect - dependency-name: minimatch dependency-version: 5.1.9 dependency-type: indirect - dependency-name: eslint-config-canonical dependency-version: 42.8.3 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- src/web/package-lock.json | 290 +++++++++++++++++++++++----------------------- src/web/package.json | 2 +- 2 files changed, 146 insertions(+), 146 deletions(-) (limited to 'src') diff --git a/src/web/package-lock.json b/src/web/package-lock.json index e3b4e90c..0b3b5528 100644 --- a/src/web/package-lock.json +++ b/src/web/package-lock.json @@ -32,7 +32,7 @@ "@semantic-ui-react/craco-less": "^3.0.0", "@semantic-ui-react/css-patch": "^1.0.0", "eslint": "^8.56.0", - "eslint-config-canonical": "^42.8.1", + "eslint-config-canonical": "^42.8.3", "react-scripts": "^5.0.0" } }, @@ -8654,10 +8654,11 @@ } }, "node_modules/eslint-config-canonical": { - "version": "42.8.1", - "resolved": "https://registry.npmjs.org/eslint-config-canonical/-/eslint-config-canonical-42.8.1.tgz", - "integrity": "sha512-OsQD1TQJAVUH/tnLwumPyKFnB+wcZLIwIUJ73rLupvgD9XzinBaDf8ZAz1cPIkG/Fej3SgKvHWiPSFAp2Nd27w==", + "version": "42.8.3", + "resolved": "https://registry.npmjs.org/eslint-config-canonical/-/eslint-config-canonical-42.8.3.tgz", + "integrity": "sha512-sWPKXdlUKNI42ZIqbtyHJvrfM0jegmTZzo4xV13fvfcYefsgRSlxzXNkR+/62fsi8s/SyZsf8ZW3TyT3pv3aLg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.23.0", "@babel/eslint-parser": "^7.22.15", @@ -8666,8 +8667,8 @@ "@graphql-eslint/eslint-plugin": "^3.20.1", "@next/eslint-plugin-next": "^13.5.4", "@rushstack/eslint-patch": "^1.5.1", - "@typescript-eslint/eslint-plugin": "^6.19.0", - "@typescript-eslint/parser": "^6.19.0", + "@typescript-eslint/eslint-plugin": "^7.7.0", + "@typescript-eslint/parser": "^7.7.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-ava": "^14.0.0", @@ -8677,7 +8678,7 @@ "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-fp": "^2.3.0", "eslint-plugin-import": "npm:eslint-plugin-i@^2.28.1", - "eslint-plugin-jest": "^27.4.2", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-jsonc": "^2.10.0", "eslint-plugin-jsx-a11y": "^6.7.1", @@ -8691,7 +8692,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-regexp": "^1.15.0", "eslint-plugin-simple-import-sort": "^10.0.0", - "eslint-plugin-typescript-sort-keys": "^3.1.0", + "eslint-plugin-typescript-sort-keys": "^3.2.0", "eslint-plugin-unicorn": "^48.0.1", "eslint-plugin-vitest": "^0.3.2", "eslint-plugin-yml": "^1.10.0", @@ -8708,33 +8709,32 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8742,52 +8742,28 @@ } } }, - "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8796,16 +8772,17 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8813,25 +8790,26 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -8839,38 +8817,14 @@ } } }, - "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8878,22 +8832,23 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8906,12 +8861,13 @@ } }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, + "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -8920,17 +8876,41 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, "node_modules/eslint-config-canonical/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -8938,10 +8918,11 @@ } }, "node_modules/eslint-config-canonical/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -8973,19 +8954,20 @@ } }, "node_modules/eslint-config-canonical/node_modules/eslint-plugin-jest": { - "version": "27.6.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", - "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", + "version": "28.14.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.14.0.tgz", + "integrity": "sha512-P9s/qXSMTpRTerE2FQ0qJet2gKbcGyFTPAJipoKxmWqR6uuFqIqk8FuEfg5yBieOezVrEfAMZrEwJ6yEp+1MFQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "^5.10.0" + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.0.0 || ^6.0.0", - "eslint": "^7.0.0 || ^8.0.0", + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "jest": "*" }, "peerDependenciesMeta": { @@ -8998,10 +8980,11 @@ } }, "node_modules/eslint-config-canonical/node_modules/eslint-plugin-typescript-sort-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-3.1.0.tgz", - "integrity": "sha512-rgZeYfEguqKni/V7sbmgFu9/94UDAQd7YqNd0J7Qhw7SdLIGd0iBk2KgpjhRhe2ge4rPSLDIdFWwUiDqBOst6Q==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-typescript-sort-keys/-/eslint-plugin-typescript-sort-keys-3.3.0.tgz", + "integrity": "sha512-bRW3Rc/VNdrSP9OoY5wgjjaXCOOkZKpzvl/Mk6l8Sg8CMehVIcg9K4y33l+ZcZiknpl0aR6rKusxuCJNGZWmVw==", "dev": true, + "license": "ISC", "dependencies": { "@typescript-eslint/experimental-utils": "^5.0.0", "json-schema": "^0.4.0", @@ -9011,11 +8994,24 @@ "node": ">= 16" }, "peerDependencies": { - "@typescript-eslint/parser": "^6", + "@typescript-eslint/parser": ">=6", "eslint": "^7 || ^8", "typescript": "^3 || ^4 || ^5" } }, + "node_modules/eslint-config-canonical/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -10766,10 +10762,11 @@ } }, "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12002,10 +11999,11 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -14920,10 +14918,11 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -19994,10 +19993,11 @@ "dev": true }, "node_modules/ts-api-utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", - "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, + "license": "MIT", "engines": { "node": ">=16" }, diff --git a/src/web/package.json b/src/web/package.json index a4b30cb6..a0ffa143 100644 --- a/src/web/package.json +++ b/src/web/package.json @@ -37,7 +37,7 @@ "@semantic-ui-react/craco-less": "^3.0.0", "@semantic-ui-react/css-patch": "^1.0.0", "eslint": "^8.56.0", - "eslint-config-canonical": "^42.8.1", + "eslint-config-canonical": "^42.8.3", "react-scripts": "^5.0.0" }, "homepage": ".", -- cgit v1.2.3 From f25257f58887b56e3b12aa98c6260e56795b344c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 28 Feb 2026 20:39:47 -0600 Subject: ensure execute bits are set on directory mode --- src/slskd/Files/FileExtensions.cs | 28 ++++++++ src/slskd/Files/FileService.cs | 4 +- .../slskd.Tests.Unit/Files/FileExtensionsTests.cs | 75 ++++++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Files/FileExtensions.cs b/src/slskd/Files/FileExtensions.cs index 4aa7a648..4a0a2369 100644 --- a/src/slskd/Files/FileExtensions.cs +++ b/src/slskd/Files/FileExtensions.cs @@ -59,4 +59,32 @@ public static class FileExtensions return (UnixFileMode)mode; } + + /// + /// Returns the specified with execute flags added for each read flag, ensuring that the resulting + /// mask can be used for directories (which require the execute flag for traversal). + /// + /// The existing mode. + /// The updated mode. + public static UnixFileMode WithExecuteFlagsForEachReadFlag(this UnixFileMode unixFileMode) + { + var u = unixFileMode; + + if (u.HasFlag(UnixFileMode.UserRead)) + { + u |= UnixFileMode.UserExecute; + } + + if (u.HasFlag(UnixFileMode.GroupRead)) + { + u |= UnixFileMode.GroupExecute; + } + + if (u.HasFlag(UnixFileMode.OtherRead)) + { + u |= UnixFileMode.OtherExecute; + } + + return u; + } } \ No newline at end of file diff --git a/src/slskd/Files/FileService.cs b/src/slskd/Files/FileService.cs index de577b6c..a325a588 100644 --- a/src/slskd/Files/FileService.cs +++ b/src/slskd/Files/FileService.cs @@ -333,7 +333,7 @@ namespace slskd.Files { if (!OperatingSystem.IsWindows() && unixCreateMode.HasValue) { - Directory.CreateDirectory(path, unixCreateMode.Value); + Directory.CreateDirectory(path, unixCreateMode.Value.WithExecuteFlagsForEachReadFlag()); } else { @@ -407,7 +407,7 @@ namespace slskd.Files { if (!OperatingSystem.IsWindows() && unixCreateMode.HasValue) { - Directory.CreateDirectory(destinationDirectory, unixCreateMode.Value); + Directory.CreateDirectory(destinationDirectory, unixCreateMode.Value.WithExecuteFlagsForEachReadFlag()); } else { diff --git a/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs b/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs index c270bb31..ea24bbd4 100644 --- a/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs +++ b/tests/slskd.Tests.Unit/Files/FileExtensionsTests.cs @@ -68,4 +68,79 @@ public class FileExtensionsTests Assert.NotNull(ex); Assert.IsType(ex); } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_UserExecute_When_UserRead_Is_Set() + { + var result = UnixFileMode.UserRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.UserExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_GroupExecute_When_GroupRead_Is_Set() + { + var result = UnixFileMode.GroupRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.GroupExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Adds_OtherExecute_When_OtherRead_Is_Set() + { + var result = UnixFileMode.OtherRead.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.OtherExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_UserExecute_When_UserRead_Is_Not_Set() + { + var result = UnixFileMode.UserWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.UserExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_GroupExecute_When_GroupRead_Is_Not_Set() + { + var result = UnixFileMode.GroupWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.GroupExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Does_Not_Add_OtherExecute_When_OtherRead_Is_Not_Set() + { + var result = UnixFileMode.OtherWrite.WithExecuteFlagsForEachReadFlag(); + + Assert.False(result.HasFlag(UnixFileMode.OtherExecute)); + } + + [Fact] + public void WithExecuteFlagsForEachReadFlag_Preserves_Existing_Flags() + { + var mode = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead; + + var result = mode.WithExecuteFlagsForEachReadFlag(); + + Assert.True(result.HasFlag(UnixFileMode.UserRead)); + Assert.True(result.HasFlag(UnixFileMode.UserWrite)); + Assert.True(result.HasFlag(UnixFileMode.GroupRead)); + } + + [Theory] + [InlineData(UnixFileMode.UserRead | UnixFileMode.GroupRead | UnixFileMode.OtherRead, + UnixFileMode.UserRead | UnixFileMode.UserExecute | UnixFileMode.GroupRead | UnixFileMode.GroupExecute | UnixFileMode.OtherRead | UnixFileMode.OtherExecute)] + [InlineData(UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead | UnixFileMode.OtherRead, + UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute | UnixFileMode.GroupRead | UnixFileMode.GroupExecute | UnixFileMode.OtherRead | UnixFileMode.OtherExecute)] + [InlineData(UnixFileMode.None, UnixFileMode.None)] + [InlineData(UnixFileMode.UserWrite | UnixFileMode.GroupWrite | UnixFileMode.OtherWrite, + UnixFileMode.UserWrite | UnixFileMode.GroupWrite | UnixFileMode.OtherWrite)] + public void WithExecuteFlagsForEachReadFlag_Works_As_Expected(UnixFileMode input, UnixFileMode expected) + { + var result = input.WithExecuteFlagsForEachReadFlag(); + + Assert.Equal(expected, result); + } } \ No newline at end of file -- cgit v1.2.3 From d7e3cbf77f805abb623be3bb65b32ca540caf620 Mon Sep 17 00:00:00 2001 From: Rick Fletcher Date: Sun, 8 Mar 2026 20:15:47 -0400 Subject: Fix "Search Again" As described in issue #1152, the "Search Again" button isn't working. I believe this change fixes the bug (seems to work for me locally), where a `search` key is missing from a function call. The bug appears to have been introduced as part of this large `eslint` commit: https://github.com/slskd/slskd/commit/4bcbde71c847a7a8c73d8ff2399a84f1d61fe766#diff-3e5657a1e0b87e183db69937ea840c41083f462cbe751b6105f11a4918ea03a0L130-L132 --- src/web/src/components/Search/Detail/SearchDetail.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/web/src/components/Search/Detail/SearchDetail.jsx b/src/web/src/components/Search/Detail/SearchDetail.jsx index 1ec53849..458da3d3 100644 --- a/src/web/src/components/Search/Detail/SearchDetail.jsx +++ b/src/web/src/components/Search/Detail/SearchDetail.jsx @@ -129,7 +129,7 @@ const SearchDetail = ({ const create = async ({ navigate, search: searchForCreate }) => { reset(); - onCreate({ navigate, searchForCreate }); + onCreate({ navigate, search: searchForCreate }); }; const remove = async () => { -- cgit v1.2.3 From cca8a2d11aadfb311beaa9c6369791e4dea0cc63 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 17 Feb 2026 21:44:14 -0600 Subject: change migration naming scheme to order by year --- src/slskd/Core/Data/Migrations/README.md | 2 +- .../Migrations/Z04012025_TransferStateMigration.cs | 236 --------------------- .../Z07062025_TransferIndexesMigration.cs | 92 -------- ...Z07262025_PrivateMessageWasReplayedMigration.cs | 84 -------- ...Z12282025_AdditionalTransferIndexesMigration.cs | 93 -------- .../Z2025_04_01_TransferStateMigration.cs | 236 +++++++++++++++++++++ .../Z2025_07_06_TransferIndexesMigration.cs | 92 ++++++++ ...025_07_26_PrivateMessageWasReplayedMigration.cs | 83 ++++++++ ...025_12_28_AdditionalTransferIndexesMigration.cs | 93 ++++++++ 9 files changed, 505 insertions(+), 506 deletions(-) delete mode 100644 src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs delete mode 100644 src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs delete mode 100644 src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs delete mode 100644 src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs create mode 100644 src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs create mode 100644 src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs create mode 100644 src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs create mode 100644 src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs (limited to 'src') diff --git a/src/slskd/Core/Data/Migrations/README.md b/src/slskd/Core/Data/Migrations/README.md index 2b5fd6f4..46da7ded 100644 --- a/src/slskd/Core/Data/Migrations/README.md +++ b/src/slskd/Core/Data/Migrations/README.md @@ -11,7 +11,7 @@ The `Migrator` creates a backup of each database prior to running any migrations Each migration must be created as a class that implements the `IMigration` interface. The naming convention for migration classes is: ``` -Z_Migration +Z_Migration ``` Migrations MUST: diff --git a/src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs b/src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs deleted file mode 100644 index c6e3d2f1..00000000 --- a/src/slskd/Core/Data/Migrations/Z04012025_TransferStateMigration.cs +++ /dev/null @@ -1,236 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd.Migrations; - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Microsoft.Data.Sqlite; -using Serilog; -using slskd.Transfers; - -/// -/// Updates the Transfers table to: -/// -/// * Add a new StateDescription (TEXT) column -/// * Copy the current (string) contents of the State column to StateDescription -/// * Change the type of the State column to INTEGER -/// * Set the contents of the State column to the numeric representation of the existing State -/// -/// This is necessary because Entity Framework doesn't work with [Flags] enums that are stored -/// as strings; it tries to use bitwise operators to apply HasFlags(), and these obviously don't -/// work against strings. Not sure why EF didn't complain about this, but here we are. -/// -public class Z04012025_TransferStateMigration : IMigration -{ - public Z04012025_TransferStateMigration(ConnectionStringDictionary connectionStrings) - { - ConnectionString = connectionStrings[Database.Transfers]; - } - - private ILogger Log { get; } = Serilog.Log.ForContext(); - private string ConnectionString { get; } - - public bool NeedsToBeApplied() - { - // first, check the existing database to see if the StateDescription column exists - // if it does, the migration has already been applied, or the database has been recreated - var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); - var txfers = schema["Transfers"]; - - return !txfers.Any(c => c.Name == nameof(Transfer.StateDescription)); - } - - public void Apply() - { - if (!NeedsToBeApplied()) - { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z04012025_TransferStateMigration)); - return; - } - - using var connection = new SqliteConnection(ConnectionString); - connection.Open(); - - // get a distinct list of states from the existing data and translate each into the corresponding integer - var stateMapping = GetStateMapping(connection); - - ModifyTableAndMassageData(connection, stateMapping); - } - - private Dictionary GetStateMapping(SqliteConnection connection) - { - Log.Debug("Fetching states and mapping to integers..."); - - using var command = new SqliteCommand("SELECT DISTINCT State FROM Transfers;", connection); - using var reader = command.ExecuteReader(); - - var dict = new Dictionary(); - - while (reader.Read()) - { - var state = reader.GetString(0); - dict[state] = (int)Enum.Parse(typeof(Z04012025_TransferStateMigration_TransferStates), state); - } - - Log.Debug("State -> int map: {Map}", dict); - return dict; - } - - private void ModifyTableAndMassageData(SqliteConnection connection, Dictionary stateMapping) - { - using var transaction = connection.BeginTransaction(); - - try - { - /* - rename old table so we can create the new one with the layout we want - while preserving the existing data - */ - var rename = @" - ALTER TABLE Transfers RENAME TO Transfers_old; - "; - - using var renameCommand = new SqliteCommand(rename, connection, transaction); - renameCommand.ExecuteNonQuery(); - - /* - create the new table with StateDescription appearing after State - */ - var create = @" - CREATE TABLE Transfers ( - Id TEXT NOT NULL, - Username TEXT, - Direction TEXT NOT NULL, - Filename TEXT, - Size INTEGER NOT NULL, - StartOffset INTEGER NOT NULL, - State INTEGER NOT NULL, - StateDescription TEXT, -- new column - RequestedAt TEXT NOT NULL, - EnqueuedAt TEXT, - StartedAt TEXT, - EndedAt TEXT, - BytesTransferred INTEGER NOT NULL, - AverageSpeed REAL NOT NULL, - PlaceInQueue INTEGER, - Exception TEXT, - Removed INTEGER NOT NULL, - CONSTRAINT PK_Transfers PRIMARY KEY(Id) - ); - "; - - using var createCommand = new SqliteCommand(create, connection, transaction); - createCommand.ExecuteNonQuery(); - - Log.Information("> Schema changes applied, copying data..."); - - /* - copy the existing data into the new table - */ - var copy = @" - INSERT INTO Transfers ( - Id, Username, Direction, Filename, Size, StartOffset, State, - RequestedAt, EnqueuedAt, StartedAt, EndedAt, BytesTransferred, - AverageSpeed, PlaceInQueue, Exception, Removed - ) - SELECT - Id, Username, Direction, Filename, Size, StartOffset, State, - RequestedAt, EnqueuedAt, StartedAt, EndedAt, BytesTransferred, - AverageSpeed, PlaceInQueue, Exception, Removed - FROM Transfers_old;"; - - using var copyCommand = new SqliteCommand(copy, connection, transaction); - copyCommand.ExecuteNonQuery(); - - Log.Information("> Data copied, adjusting columns..."); - - /* - we no longer need the old table, so drop it - */ - using var dropCommand = new SqliteCommand("DROP TABLE Transfers_old;", connection, transaction); - dropCommand.ExecuteNonQuery(); - - /* - copy the existing (string) State value from State to StateDescription - */ - var copyColumnCommand = new SqliteCommand("UPDATE Transfers SET StateDescription = State", connection, transaction); - copyColumnCommand.ExecuteNonQuery(); - - /* - for each of the distinct State values that exist in the data, convert the string - representation into the numeric - - there surely exist better ways to do this, but the reality is that 99% of the records - will be "Completed, Succeeded" (48), with a few "Completed, Errored" or "Completed, Cancelled" - sprinkled in. this should run in reasonable time for large collections - */ - var sw = new Stopwatch(); - var step = 1; - - foreach (var state in stateMapping) - { - sw.Reset(); - Log.Information("> Updating column {Step} of {Total}. This may take some time...", step++, stateMapping.Count); - - Log.Debug("Setting {String} to {Int}", state.Key, state.Value); - - var mapCommand = new SqliteCommand($"UPDATE Transfers SET State = {state.Value} WHERE State = '{state.Key}';", connection, transaction); - mapCommand.ExecuteNonQuery(); - - Log.Debug("{String} to {Int} in {Duration}", state.Key, state.Value, sw.ElapsedMilliseconds); - } - - Log.Debug("Committing transation..."); - transaction.Commit(); - Log.Debug("Transaction committed!"); - Log.Information("> Done!"); - } - catch (Exception) - { - transaction.Rollback(); - throw; - } - } - -#pragma warning disable SA1201 // Elements should appear in the correct order - /// - /// This is a copy of the TransferStates enum as it was at the time this migration was written. This exists to ensure - /// that the migration can be applied to any version of the database, even if the enum changes in the future. - /// - [Flags] - private enum Z04012025_TransferStateMigration_TransferStates - { - None = 0, - Requested = 1, - Queued = 2, - Initializing = 4, - InProgress = 8, - Completed = 16, - Succeeded = 32, - Cancelled = 64, - TimedOut = 128, - Errored = 256, - Rejected = 512, - Aborted = 1024, - Locally = 2048, - Remotely = 4096, - } -#pragma warning restore SA1201 // Elements should appear in the correct order -} diff --git a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs deleted file mode 100644 index 8ae13734..00000000 --- a/src/slskd/Core/Data/Migrations/Z07062025_TransferIndexesMigration.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd.Migrations; - -using System; -using System.Linq; -using Microsoft.Data.Sqlite; -using Serilog; - -/// -/// Updates the Transfers table to add indexes on the Direction and State columns. -/// -public class Z07062025_TransferIndexesMigration : IMigration -{ - public Z07062025_TransferIndexesMigration(ConnectionStringDictionary connectionStrings) - { - ConnectionString = connectionStrings[Database.Transfers]; - } - - private ILogger Log { get; } = Serilog.Log.ForContext(); - private string ConnectionString { get; } - - public bool NeedsToBeApplied() - { - // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply - var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); - var txfers = idxes["Transfers"]; - - var directionExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_Direction", StringComparison.OrdinalIgnoreCase)); - var stateExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_State", StringComparison.OrdinalIgnoreCase)); - - if (directionExists && stateExists) - { - return false; - } - - return true; - } - - public void Apply() - { - if (!NeedsToBeApplied()) - { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z07062025_TransferIndexesMigration)); - return; - } - - using var connection = new SqliteConnection(ConnectionString); - connection.Open(); - - using var transaction = connection.BeginTransaction(); - - try - { - Log.Information("> Adding missing index(es) on the Transfers table..."); - - var directionCommand = new SqliteCommand(@" - CREATE INDEX IF NOT EXISTS IDX_Transfers_Direction ON Transfers (Direction) - ", connection, transaction); - directionCommand.ExecuteNonQuery(); - - var stateCommand = new SqliteCommand(@" - CREATE INDEX IF NOT EXISTS IDX_Transfers_State ON Transfers (State) - ", connection, transaction); - stateCommand.ExecuteNonQuery(); - - Log.Information("> Index(es) created"); - transaction.Commit(); - Log.Information("> Done!"); - } - catch (Exception) - { - transaction.Rollback(); - throw; - } - } -} diff --git a/src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs b/src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs deleted file mode 100644 index a458a756..00000000 --- a/src/slskd/Core/Data/Migrations/Z07262025_PrivateMessageWasReplayedMigration.cs +++ /dev/null @@ -1,84 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd.Migrations; - -using System; -using System.Linq; -using Microsoft.Data.Sqlite; -using Serilog; -using slskd.Messaging; - -/// -/// Updates the Transfers table to add indexes on the Direction and State columns. -/// -public class Z07262025_PrivateMessageWasReplayedMigration : IMigration -{ - public Z07262025_PrivateMessageWasReplayedMigration(ConnectionStringDictionary connectionStrings) - { - ConnectionString = connectionStrings[Database.Messaging]; - } - - private ILogger Log { get; } = Serilog.Log.ForContext(); - private string ConnectionString { get; } - - public bool NeedsToBeApplied() - { - // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply - var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); - var pms = schema["PrivateMessages"]; - - if (pms.Any(r => r.Name == nameof(PrivateMessage.WasReplayed))) - { - return false; - } - - return true; - } - - public void Apply() - { - if (!NeedsToBeApplied()) - { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z07262025_PrivateMessageWasReplayedMigration)); - return; - } - - using var connection = new SqliteConnection(ConnectionString); - connection.Open(); - - using var transaction = connection.BeginTransaction(); - - try - { - Log.Information("> Adding missing column WasReplayed to PrivateMessages table..."); - - var addColumnCommand = new SqliteCommand(@" - ALTER TABLE PrivateMessages ADD COLUMN WasReplayed INTEGER NOT NULL DEFAULT 0 - ", connection, transaction); - addColumnCommand.ExecuteNonQuery(); - - transaction.Commit(); - Log.Information("> Done!"); - } - catch (Exception) - { - transaction.Rollback(); - throw; - } - } -} diff --git a/src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs deleted file mode 100644 index 2deffeb3..00000000 --- a/src/slskd/Core/Data/Migrations/Z12282025_AdditionalTransferIndexesMigration.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd.Migrations; - -using System; -using System.Linq; -using Microsoft.Data.Sqlite; -using Serilog; - -/// -/// Adds additional indexes to the Transfers table for Removed, Username/Filename, and user upload statistics. -/// -public class Z12282025_AdditionalTransferIndexesMigration : IMigration -{ - public Z12282025_AdditionalTransferIndexesMigration(ConnectionStringDictionary connectionStrings) - { - ConnectionString = connectionStrings[Database.Transfers]; - } - - private ILogger Log { get; } = Serilog.Log.ForContext(); - private string ConnectionString { get; } - - public bool NeedsToBeApplied() - { - // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply - var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); - var txfers = idxes["Transfers"]; - - var removedExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_Removed", StringComparison.OrdinalIgnoreCase)); - var usernameFilenameExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_UsernameFilename", StringComparison.OrdinalIgnoreCase)); - var statsExist = txfers.Any(c => c.Name.Equals("IDX_Transfers_UserUploadStatistics", StringComparison.OrdinalIgnoreCase)); - - if (removedExists && usernameFilenameExists && statsExist) - { - return false; - } - - return true; - } - - public void Apply() - { - if (!NeedsToBeApplied()) - { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z12282025_AdditionalTransferIndexesMigration)); - return; - } - - using var connection = new SqliteConnection(ConnectionString); - connection.Open(); - - using var transaction = connection.BeginTransaction(); - - try - { - void Exec(string sql) - { - using var command = new SqliteCommand(sql, connection, transaction); - command.ExecuteNonQuery(); - } - - Log.Information("> Adding missing index(es) on the Transfers table..."); - - Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_Removed ON Transfers (Removed)"); - Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_UsernameFilename ON Transfers (Username, Filename)"); - Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_UserUploadStatistics ON Transfers (Username, Direction, EndedAt, StartedAt, State, Size)"); - - Log.Information("> Index(es) created"); - transaction.Commit(); - Log.Information("> Done!"); - } - catch (Exception) - { - transaction.Rollback(); - throw; - } - } -} diff --git a/src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs new file mode 100644 index 00000000..146541dd --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2025_04_01_TransferStateMigration.cs @@ -0,0 +1,236 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; +using slskd.Transfers; + +/// +/// Updates the Transfers table to: +/// +/// * Add a new StateDescription (TEXT) column +/// * Copy the current (string) contents of the State column to StateDescription +/// * Change the type of the State column to INTEGER +/// * Set the contents of the State column to the numeric representation of the existing State +/// +/// This is necessary because Entity Framework doesn't work with [Flags] enums that are stored +/// as strings; it tries to use bitwise operators to apply HasFlags(), and these obviously don't +/// work against strings. Not sure why EF didn't complain about this, but here we are. +/// +public class Z2025_04_01_TransferStateMigration : IMigration +{ + public Z2025_04_01_TransferStateMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Transfers]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + // first, check the existing database to see if the StateDescription column exists + // if it does, the migration has already been applied, or the database has been recreated + var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); + var txfers = schema["Transfers"]; + + return !txfers.Any(c => c.Name == nameof(Transfer.StateDescription)); + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_04_01_TransferStateMigration)); + return; + } + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + // get a distinct list of states from the existing data and translate each into the corresponding integer + var stateMapping = GetStateMapping(connection); + + ModifyTableAndMassageData(connection, stateMapping); + } + + private Dictionary GetStateMapping(SqliteConnection connection) + { + Log.Debug("Fetching states and mapping to integers..."); + + using var command = new SqliteCommand("SELECT DISTINCT State FROM Transfers;", connection); + using var reader = command.ExecuteReader(); + + var dict = new Dictionary(); + + while (reader.Read()) + { + var state = reader.GetString(0); + dict[state] = (int)Enum.Parse(typeof(Z04012025_TransferStateMigration_TransferStates), state); + } + + Log.Debug("State -> int map: {Map}", dict); + return dict; + } + + private void ModifyTableAndMassageData(SqliteConnection connection, Dictionary stateMapping) + { + using var transaction = connection.BeginTransaction(); + + try + { + /* + rename old table so we can create the new one with the layout we want + while preserving the existing data + */ + var rename = @" + ALTER TABLE Transfers RENAME TO Transfers_old; + "; + + using var renameCommand = new SqliteCommand(rename, connection, transaction); + renameCommand.ExecuteNonQuery(); + + /* + create the new table with StateDescription appearing after State + */ + var create = @" + CREATE TABLE Transfers ( + Id TEXT NOT NULL, + Username TEXT, + Direction TEXT NOT NULL, + Filename TEXT, + Size INTEGER NOT NULL, + StartOffset INTEGER NOT NULL, + State INTEGER NOT NULL, + StateDescription TEXT, -- new column + RequestedAt TEXT NOT NULL, + EnqueuedAt TEXT, + StartedAt TEXT, + EndedAt TEXT, + BytesTransferred INTEGER NOT NULL, + AverageSpeed REAL NOT NULL, + PlaceInQueue INTEGER, + Exception TEXT, + Removed INTEGER NOT NULL, + CONSTRAINT PK_Transfers PRIMARY KEY(Id) + ); + "; + + using var createCommand = new SqliteCommand(create, connection, transaction); + createCommand.ExecuteNonQuery(); + + Log.Information("> Schema changes applied, copying data..."); + + /* + copy the existing data into the new table + */ + var copy = @" + INSERT INTO Transfers ( + Id, Username, Direction, Filename, Size, StartOffset, State, + RequestedAt, EnqueuedAt, StartedAt, EndedAt, BytesTransferred, + AverageSpeed, PlaceInQueue, Exception, Removed + ) + SELECT + Id, Username, Direction, Filename, Size, StartOffset, State, + RequestedAt, EnqueuedAt, StartedAt, EndedAt, BytesTransferred, + AverageSpeed, PlaceInQueue, Exception, Removed + FROM Transfers_old;"; + + using var copyCommand = new SqliteCommand(copy, connection, transaction); + copyCommand.ExecuteNonQuery(); + + Log.Information("> Data copied, adjusting columns..."); + + /* + we no longer need the old table, so drop it + */ + using var dropCommand = new SqliteCommand("DROP TABLE Transfers_old;", connection, transaction); + dropCommand.ExecuteNonQuery(); + + /* + copy the existing (string) State value from State to StateDescription + */ + var copyColumnCommand = new SqliteCommand("UPDATE Transfers SET StateDescription = State", connection, transaction); + copyColumnCommand.ExecuteNonQuery(); + + /* + for each of the distinct State values that exist in the data, convert the string + representation into the numeric + + there surely exist better ways to do this, but the reality is that 99% of the records + will be "Completed, Succeeded" (48), with a few "Completed, Errored" or "Completed, Cancelled" + sprinkled in. this should run in reasonable time for large collections + */ + var sw = new Stopwatch(); + var step = 1; + + foreach (var state in stateMapping) + { + sw.Reset(); + Log.Information("> Updating column {Step} of {Total}. This may take some time...", step++, stateMapping.Count); + + Log.Debug("Setting {String} to {Int}", state.Key, state.Value); + + var mapCommand = new SqliteCommand($"UPDATE Transfers SET State = {state.Value} WHERE State = '{state.Key}';", connection, transaction); + mapCommand.ExecuteNonQuery(); + + Log.Debug("{String} to {Int} in {Duration}", state.Key, state.Value, sw.ElapsedMilliseconds); + } + + Log.Debug("Committing transation..."); + transaction.Commit(); + Log.Debug("Transaction committed!"); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } + +#pragma warning disable SA1201 // Elements should appear in the correct order + /// + /// This is a copy of the TransferStates enum as it was at the time this migration was written. This exists to ensure + /// that the migration can be applied to any version of the database, even if the enum changes in the future. + /// + [Flags] + private enum Z04012025_TransferStateMigration_TransferStates + { + None = 0, + Requested = 1, + Queued = 2, + Initializing = 4, + InProgress = 8, + Completed = 16, + Succeeded = 32, + Cancelled = 64, + TimedOut = 128, + Errored = 256, + Rejected = 512, + Aborted = 1024, + Locally = 2048, + Remotely = 4096, + } +#pragma warning restore SA1201 // Elements should appear in the correct order +} diff --git a/src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs new file mode 100644 index 00000000..df93f685 --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2025_07_06_TransferIndexesMigration.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; + +/// +/// Updates the Transfers table to add indexes on the Direction and State columns. +/// +public class Z2025_07_06_TransferIndexesMigration : IMigration +{ + public Z2025_07_06_TransferIndexesMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Transfers]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply + var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); + var txfers = idxes["Transfers"]; + + var directionExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_Direction", StringComparison.OrdinalIgnoreCase)); + var stateExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_State", StringComparison.OrdinalIgnoreCase)); + + if (directionExists && stateExists) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_07_06_TransferIndexesMigration)); + return; + } + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + Log.Information("> Adding missing index(es) on the Transfers table..."); + + var directionCommand = new SqliteCommand(@" + CREATE INDEX IF NOT EXISTS IDX_Transfers_Direction ON Transfers (Direction) + ", connection, transaction); + directionCommand.ExecuteNonQuery(); + + var stateCommand = new SqliteCommand(@" + CREATE INDEX IF NOT EXISTS IDX_Transfers_State ON Transfers (State) + ", connection, transaction); + stateCommand.ExecuteNonQuery(); + + Log.Information("> Index(es) created"); + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} diff --git a/src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs new file mode 100644 index 00000000..c3f3664b --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2025_07_26_PrivateMessageWasReplayedMigration.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; +using slskd.Messaging; + +/// +/// Updates the Transfers table to add indexes on the Direction and State columns. +/// +public class Z2025_07_26_PrivateMessageWasReplayedMigration : IMigration +{ + public Z2025_07_26_PrivateMessageWasReplayedMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Messaging]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); + var pms = schema["PrivateMessages"]; + + if (pms.Any(r => r.Name == nameof(PrivateMessage.WasReplayed))) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_07_26_PrivateMessageWasReplayedMigration)); + return; + } + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + Log.Information("> Adding missing column WasReplayed to PrivateMessages table..."); + + var addColumnCommand = new SqliteCommand(@" + ALTER TABLE PrivateMessages ADD COLUMN WasReplayed INTEGER NOT NULL DEFAULT 0 + ", connection, transaction); + addColumnCommand.ExecuteNonQuery(); + + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} diff --git a/src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs b/src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs new file mode 100644 index 00000000..e66cc59d --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2025_12_28_AdditionalTransferIndexesMigration.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; + +/// +/// Adds additional indexes to the Transfers table for Removed, Username/Filename, and user upload statistics. +/// +public class Z2025_12_28_AdditionalTransferIndexesMigration : IMigration +{ + public Z2025_12_28_AdditionalTransferIndexesMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Transfers]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + // check to see if *BOTH* of the indexes are in place. if one or both are missing, we must apply + var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); + var txfers = idxes["Transfers"]; + + var removedExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_Removed", StringComparison.OrdinalIgnoreCase)); + var usernameFilenameExists = txfers.Any(c => c.Name.Equals("IDX_Transfers_UsernameFilename", StringComparison.OrdinalIgnoreCase)); + var statsExist = txfers.Any(c => c.Name.Equals("IDX_Transfers_UserUploadStatistics", StringComparison.OrdinalIgnoreCase)); + + if (removedExists && usernameFilenameExists && statsExist) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2025_12_28_AdditionalTransferIndexesMigration)); + return; + } + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + void Exec(string sql) + { + using var command = new SqliteCommand(sql, connection, transaction); + command.ExecuteNonQuery(); + } + + Log.Information("> Adding missing index(es) on the Transfers table..."); + + Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_Removed ON Transfers (Removed)"); + Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_UsernameFilename ON Transfers (Username, Filename)"); + Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_UserUploadStatistics ON Transfers (Username, Direction, EndedAt, StartedAt, State, Size)"); + + Log.Information("> Index(es) created"); + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} -- cgit v1.2.3 From 3de4ecd75e033328874323043f662964e0f800ac Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 17 Feb 2026 21:44:42 -0600 Subject: add Attempts and GroupId to Transfer --- ...26_02_17_TransferAttemptsAndGroupIdMigration.cs | 109 +++++++++++++++++++++ src/slskd/Core/Data/Migrator.cs | 9 +- src/slskd/Transfers/TransfersDbContext.cs | 10 ++ src/slskd/Transfers/Types/Transfer.cs | 4 + 4 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs (limited to 'src') diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs new file mode 100644 index 00000000..dfdd68eb --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; +using slskd.Transfers; + +/// +/// Updates the Transfers table to add Attempts and GroupId columns. +/// +public class Z2026_02_17_TransferAttemptsAndGroupIdMigration : IMigration +{ + public Z2026_02_17_TransferAttemptsAndGroupIdMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Transfers]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); + var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); + + var columns = schema["Transfers"]; + var indexes = idxes["Transfers"]; + + // check to see if the Attempts and GroupId columns exist + if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) + && columns.Any(c => c.Name == nameof(Transfer.GroupId)) + && indexes.Any(i => i.Name.Equals("IDX_Transfers_GroupId", StringComparison.OrdinalIgnoreCase))) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2026_02_17_TransferAttemptsAndGroupIdMigration)); + return; + } + + var columns = SchemaInspector.GetDatabaseSchema(ConnectionString)["Transfers"]; + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + void Exec(string sql) + { + using var command = new SqliteCommand(sql, connection, transaction); + command.ExecuteNonQuery(); + } + + Log.Information("> Adding GroupId and Attempts columns to the Transfers table..."); + + if (!columns.Any(c => c.Name == nameof(Transfer.GroupId))) + { + Exec("ALTER TABLE Transfers ADD COLUMN GroupId TEXT NULL;"); + } + + if (!columns.Any(c => c.Name == nameof(Transfer.Attempts))) + { + Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); + } + + Log.Information("> New columns added"); + + Log.Information("> Adding missing index(es) on the Transfers table..."); + + Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_GroupId ON Transfers (GroupId)"); + + Log.Information("> Index(es) created"); + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} diff --git a/src/slskd/Core/Data/Migrator.cs b/src/slskd/Core/Data/Migrator.cs index 5561de4b..a5096143 100644 --- a/src/slskd/Core/Data/Migrator.cs +++ b/src/slskd/Core/Data/Migrator.cs @@ -40,10 +40,11 @@ public class Migrator Migrations = new() { - { nameof(Z04012025_TransferStateMigration), new Z04012025_TransferStateMigration(connectionStrings: Databases) }, - { nameof(Z07062025_TransferIndexesMigration), new Z07062025_TransferIndexesMigration(connectionStrings: Databases) }, - { nameof(Z07262025_PrivateMessageWasReplayedMigration), new Z07262025_PrivateMessageWasReplayedMigration(connectionStrings: Databases) }, - { nameof(Z12282025_AdditionalTransferIndexesMigration), new Z12282025_AdditionalTransferIndexesMigration(connectionStrings: Databases) }, + { nameof(Z2025_04_01_TransferStateMigration), new Z2025_04_01_TransferStateMigration(connectionStrings: Databases) }, + { nameof(Z2025_07_06_TransferIndexesMigration), new Z2025_07_06_TransferIndexesMigration(connectionStrings: Databases) }, + { nameof(Z2025_07_26_PrivateMessageWasReplayedMigration), new Z2025_07_26_PrivateMessageWasReplayedMigration(connectionStrings: Databases) }, + { nameof(Z2025_12_28_AdditionalTransferIndexesMigration), new Z2025_12_28_AdditionalTransferIndexesMigration(connectionStrings: Databases) }, + { nameof(Z2026_02_17_TransferAttemptsAndGroupIdMigration), new Z2026_02_17_TransferAttemptsAndGroupIdMigration(connectionStrings: Databases) }, }; } diff --git a/src/slskd/Transfers/TransfersDbContext.cs b/src/slskd/Transfers/TransfersDbContext.cs index 422595e9..79171809 100644 --- a/src/slskd/Transfers/TransfersDbContext.cs +++ b/src/slskd/Transfers/TransfersDbContext.cs @@ -76,6 +76,16 @@ namespace slskd.Transfers .HasIndex(t => t.Removed) .HasDatabaseName("IDX_Transfers_Removed"); + modelBuilder + .Entity() + .Property(e => e.Attempts) + .HasDefaultValue(0); // force EF to match the migration + + modelBuilder + .Entity() + .HasIndex(t => t.GroupId) + .HasDatabaseName("IDX_Transfers_GroupId"); + // covers the check for existing records when enqueueing uploads and downloads modelBuilder .Entity() diff --git a/src/slskd/Transfers/Types/Transfer.cs b/src/slskd/Transfers/Types/Transfer.cs index 338aba38..e2ef6d5d 100644 --- a/src/slskd/Transfers/Types/Transfer.cs +++ b/src/slskd/Transfers/Types/Transfer.cs @@ -25,6 +25,8 @@ namespace slskd.Transfers public class Transfer { + public Guid? GroupId { get; init; } = null; + [Key] public Guid Id { get; init; } public string Username { get; init; } @@ -65,6 +67,8 @@ namespace slskd.Transfers public int? PlaceInQueue { get; set; } public string Exception { get; set; } + public int Attempts { get; set; } = 0; + [JsonIgnore] public bool Removed { get; set; } -- cgit v1.2.3 From 6751f5bb1a34d030e6ce5078b20e57b6ea0053a5 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 1 Mar 2026 18:52:02 -0600 Subject: rename GroupId to BatchId --- ...26_02_17_TransferAttemptsAndBatchIdMigration.cs | 109 +++++++++++++++++++++ ...26_02_17_TransferAttemptsAndGroupIdMigration.cs | 109 --------------------- src/slskd/Core/Data/Migrator.cs | 2 +- src/slskd/Transfers/Extensions.cs | 1 + src/slskd/Transfers/TransfersDbContext.cs | 4 +- src/slskd/Transfers/Types/Transfer.cs | 2 +- 6 files changed, 114 insertions(+), 113 deletions(-) create mode 100644 src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs delete mode 100644 src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs (limited to 'src') diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs new file mode 100644 index 00000000..66083a83 --- /dev/null +++ b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Migrations; + +using System; +using System.Linq; +using Microsoft.Data.Sqlite; +using Serilog; +using slskd.Transfers; + +/// +/// Updates the Transfers table to add Attempts and BatchId columns. +/// +public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration +{ + public Z2026_02_17_TransferAttemptsAndBatchIdMigration(ConnectionStringDictionary connectionStrings) + { + ConnectionString = connectionStrings[Database.Transfers]; + } + + private ILogger Log { get; } = Serilog.Log.ForContext(); + private string ConnectionString { get; } + + public bool NeedsToBeApplied() + { + var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); + var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); + + var columns = schema["Transfers"]; + var indexes = idxes["Transfers"]; + + // check to see if the Attempts and BatchId columns exist + if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) + && columns.Any(c => c.Name == nameof(Transfer.BatchId)) + && indexes.Any(i => i.Name.Equals("IDX_Transfers_BatchId", StringComparison.OrdinalIgnoreCase))) + { + return false; + } + + return true; + } + + public void Apply() + { + if (!NeedsToBeApplied()) + { + Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2026_02_17_TransferAttemptsAndBatchIdMigration)); + return; + } + + var columns = SchemaInspector.GetDatabaseSchema(ConnectionString)["Transfers"]; + + using var connection = new SqliteConnection(ConnectionString); + connection.Open(); + + using var transaction = connection.BeginTransaction(); + + try + { + void Exec(string sql) + { + using var command = new SqliteCommand(sql, connection, transaction); + command.ExecuteNonQuery(); + } + + Log.Information("> Adding BatchId and Attempts columns to the Transfers table..."); + + if (!columns.Any(c => c.Name == nameof(Transfer.BatchId))) + { + Exec("ALTER TABLE Transfers ADD COLUMN BatchId TEXT NULL;"); + } + + if (!columns.Any(c => c.Name == nameof(Transfer.Attempts))) + { + Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); + } + + Log.Information("> New columns added"); + + Log.Information("> Adding missing index(es) on the Transfers table..."); + + Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_BatchId ON Transfers (BatchId)"); + + Log.Information("> Index(es) created"); + transaction.Commit(); + Log.Information("> Done!"); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + } +} diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs deleted file mode 100644 index dfdd68eb..00000000 --- a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndGroupIdMigration.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// Copyright (c) slskd Team. All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see https://www.gnu.org/licenses/. -// - -namespace slskd.Migrations; - -using System; -using System.Linq; -using Microsoft.Data.Sqlite; -using Serilog; -using slskd.Transfers; - -/// -/// Updates the Transfers table to add Attempts and GroupId columns. -/// -public class Z2026_02_17_TransferAttemptsAndGroupIdMigration : IMigration -{ - public Z2026_02_17_TransferAttemptsAndGroupIdMigration(ConnectionStringDictionary connectionStrings) - { - ConnectionString = connectionStrings[Database.Transfers]; - } - - private ILogger Log { get; } = Serilog.Log.ForContext(); - private string ConnectionString { get; } - - public bool NeedsToBeApplied() - { - var schema = SchemaInspector.GetDatabaseSchema(ConnectionString); - var idxes = SchemaInspector.GetDatabaseIndexes(ConnectionString); - - var columns = schema["Transfers"]; - var indexes = idxes["Transfers"]; - - // check to see if the Attempts and GroupId columns exist - if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) - && columns.Any(c => c.Name == nameof(Transfer.GroupId)) - && indexes.Any(i => i.Name.Equals("IDX_Transfers_GroupId", StringComparison.OrdinalIgnoreCase))) - { - return false; - } - - return true; - } - - public void Apply() - { - if (!NeedsToBeApplied()) - { - Log.Information("> Migration {Name} is not necessary or has already been applied", nameof(Z2026_02_17_TransferAttemptsAndGroupIdMigration)); - return; - } - - var columns = SchemaInspector.GetDatabaseSchema(ConnectionString)["Transfers"]; - - using var connection = new SqliteConnection(ConnectionString); - connection.Open(); - - using var transaction = connection.BeginTransaction(); - - try - { - void Exec(string sql) - { - using var command = new SqliteCommand(sql, connection, transaction); - command.ExecuteNonQuery(); - } - - Log.Information("> Adding GroupId and Attempts columns to the Transfers table..."); - - if (!columns.Any(c => c.Name == nameof(Transfer.GroupId))) - { - Exec("ALTER TABLE Transfers ADD COLUMN GroupId TEXT NULL;"); - } - - if (!columns.Any(c => c.Name == nameof(Transfer.Attempts))) - { - Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); - } - - Log.Information("> New columns added"); - - Log.Information("> Adding missing index(es) on the Transfers table..."); - - Exec("CREATE INDEX IF NOT EXISTS IDX_Transfers_GroupId ON Transfers (GroupId)"); - - Log.Information("> Index(es) created"); - transaction.Commit(); - Log.Information("> Done!"); - } - catch (Exception) - { - transaction.Rollback(); - throw; - } - } -} diff --git a/src/slskd/Core/Data/Migrator.cs b/src/slskd/Core/Data/Migrator.cs index a5096143..c1089090 100644 --- a/src/slskd/Core/Data/Migrator.cs +++ b/src/slskd/Core/Data/Migrator.cs @@ -44,7 +44,7 @@ public class Migrator { nameof(Z2025_07_06_TransferIndexesMigration), new Z2025_07_06_TransferIndexesMigration(connectionStrings: Databases) }, { nameof(Z2025_07_26_PrivateMessageWasReplayedMigration), new Z2025_07_26_PrivateMessageWasReplayedMigration(connectionStrings: Databases) }, { nameof(Z2025_12_28_AdditionalTransferIndexesMigration), new Z2025_12_28_AdditionalTransferIndexesMigration(connectionStrings: Databases) }, - { nameof(Z2026_02_17_TransferAttemptsAndGroupIdMigration), new Z2026_02_17_TransferAttemptsAndGroupIdMigration(connectionStrings: Databases) }, + { nameof(Z2026_02_17_TransferAttemptsAndBatchIdMigration), new Z2026_02_17_TransferAttemptsAndBatchIdMigration(connectionStrings: Databases) }, }; } diff --git a/src/slskd/Transfers/Extensions.cs b/src/slskd/Transfers/Extensions.cs index 7ec1b55c..e2295e10 100644 --- a/src/slskd/Transfers/Extensions.cs +++ b/src/slskd/Transfers/Extensions.cs @@ -23,6 +23,7 @@ namespace slskd.Transfers { return new Transfer() { + BatchId = transfer.BatchId, Id = transfer.Id, Username = transfer.Username, Direction = transfer.Direction, diff --git a/src/slskd/Transfers/TransfersDbContext.cs b/src/slskd/Transfers/TransfersDbContext.cs index 79171809..d82259e7 100644 --- a/src/slskd/Transfers/TransfersDbContext.cs +++ b/src/slskd/Transfers/TransfersDbContext.cs @@ -83,8 +83,8 @@ namespace slskd.Transfers modelBuilder .Entity() - .HasIndex(t => t.GroupId) - .HasDatabaseName("IDX_Transfers_GroupId"); + .HasIndex(t => t.BatchId) + .HasDatabaseName("IDX_Transfers_BatchId"); // covers the check for existing records when enqueueing uploads and downloads modelBuilder diff --git a/src/slskd/Transfers/Types/Transfer.cs b/src/slskd/Transfers/Types/Transfer.cs index e2ef6d5d..56f6b333 100644 --- a/src/slskd/Transfers/Types/Transfer.cs +++ b/src/slskd/Transfers/Types/Transfer.cs @@ -25,7 +25,7 @@ namespace slskd.Transfers public class Transfer { - public Guid? GroupId { get; init; } = null; + public Guid? BatchId { get; init; } = null; [Key] public Guid Id { get; init; } -- cgit v1.2.3 From 01fa711484e120f91d7d21e0957f98c0842551ad Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 15 Mar 2026 11:02:41 -0500 Subject: add NextAttemptAt --- .../Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs | 8 +++++++- src/slskd/Transfers/Types/Transfer.cs | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs index 66083a83..5965f7b7 100644 --- a/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs +++ b/src/slskd/Core/Data/Migrations/Z2026_02_17_TransferAttemptsAndBatchIdMigration.cs @@ -46,6 +46,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration // check to see if the Attempts and BatchId columns exist if (columns.Any(c => c.Name == nameof(Transfer.Attempts)) + && columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt)) && columns.Any(c => c.Name == nameof(Transfer.BatchId)) && indexes.Any(i => i.Name.Equals("IDX_Transfers_BatchId", StringComparison.OrdinalIgnoreCase))) { @@ -78,7 +79,7 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration command.ExecuteNonQuery(); } - Log.Information("> Adding BatchId and Attempts columns to the Transfers table..."); + Log.Information("> Adding BatchId, Attempts, and NextAttemptAt columns to the Transfers table..."); if (!columns.Any(c => c.Name == nameof(Transfer.BatchId))) { @@ -90,6 +91,11 @@ public class Z2026_02_17_TransferAttemptsAndBatchIdMigration : IMigration Exec("ALTER TABLE Transfers ADD COLUMN Attempts INTEGER NOT NULL DEFAULT 0;"); } + if (!columns.Any(c => c.Name == nameof(Transfer.NextAttemptAt))) + { + Exec("ALTER TABLE Transfers ADD COLUMN NextAttemptAt TEXT NULL;"); + } + Log.Information("> New columns added"); Log.Information("> Adding missing index(es) on the Transfers table..."); diff --git a/src/slskd/Transfers/Types/Transfer.cs b/src/slskd/Transfers/Types/Transfer.cs index 56f6b333..7facb3ee 100644 --- a/src/slskd/Transfers/Types/Transfer.cs +++ b/src/slskd/Transfers/Types/Transfer.cs @@ -69,6 +69,8 @@ namespace slskd.Transfers public int Attempts { get; set; } = 0; + public DateTime? NextAttemptAt { get; set; } = null; + [JsonIgnore] public bool Removed { get; set; } -- cgit v1.2.3