From bda125d7613865259e926f6b8c2ea2f7e7e3ec47 Mon Sep 17 00:00:00 2001 From: ILIYA EMMANUEL Date: Sun, 30 Aug 2026 10:42:59 +0000 Subject: [PATCH 1/4] Fix Data retention rules added --- DATA_RETENTION.md | 46 + frontend/package-lock.json | 1131 ++++++++++++++++++- frontend/src/lib/notification-store.test.ts | 44 +- frontend/src/lib/notification-store.ts | 51 + frontend/src/lib/task-listing.test.ts | 75 +- frontend/src/lib/task-workflow.ts | 71 ++ 6 files changed, 1370 insertions(+), 48 deletions(-) create mode 100644 DATA_RETENTION.md diff --git a/DATA_RETENTION.md b/DATA_RETENTION.md new file mode 100644 index 0000000..949894f --- /dev/null +++ b/DATA_RETENTION.md @@ -0,0 +1,46 @@ +# Data Retention Rules + +This document defines the default retention policy for records that are stale, inactive, or no longer useful in the TaskBounty application. + +## Scope + +The retention rules apply to persistent in-memory records used by the application runtime, including: + +- Notifications created for user activity or platform broadcasts +- Completed, cancelled, or disputed task records +- Related submission and comment records that belong to expired task records + +## Categories and retention periods + +| Record category | Status / trigger | Retention period | Safe handling | +|---|---|---:|---| +| User notifications | Created and left unread/unused beyond the configured expiry window | 30 days | Delete lazily during read/write operations and when listing notifications | +| Completed task records | Finalized tasks older than the retention window | 180 days | Remove task, submissions, and comments tied to the task after expiry | +| Cancelled task records | Finalized tasks older than the retention window | 180 days | Remove the task and any dependent records after expiry | +| Disputed task records | Finalized tasks older than the retention window | 180 days | Remove the task and related discussion data after expiry | + +## Configuration + +Retention values are configured through environment variables so deployments can tune policy without changing application code: + +- `NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS` — default `30` +- `NEXT_PUBLIC_TASK_RETENTION_DAYS` — default `180` + +If the environment variable is missing or invalid, the defaults above are used. + +## Expired record handling + +Expired records are removed safely in a lazy cleanup pass before creates, reads, and listing operations. This approach avoids hard-failing operations when old data is present while ensuring stale records do not accumulate indefinitely. + +The cleanup process does the following: + +1. Identifies records older than the configured retention window. +2. Removes only inactive or finalized records eligible for deletion. +3. Deletes dependent child records (e.g., task submissions/comments) when the parent task is expired. +4. Keeps active or still-valid records intact. + +## Operational guidance + +- Prefer a short retention period for notifications to avoid indefinite in-memory growth. +- Keep task retention longer than notifications because historical task data may be useful for auditing and review. +- If a stricter compliance requirement is introduced later, update this document and the corresponding environment values together. diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 3efb82a..ea795da 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -36,7 +36,8 @@ "react-spinners": "^0.17.0", "recharts": "^3.5.1", "tailwind-merge": "^3.3.1", - "tailwind-scrollbar-hide": "^4.0.0" + "tailwind-scrollbar-hide": "^4.0.0", + "zod": "^4.4.3" }, "devDependencies": { "@tailwindcss/postcss": "^4", @@ -46,7 +47,8 @@ "eslint": "^9", "eslint-config-next": "16.1.3", "tailwindcss": "^4", - "typescript": "^5" + "typescript": "^5", + "vitest": "^4.1.10" } }, "node_modules/@albedo-link/intent": { @@ -1994,6 +1996,16 @@ "node": ">=12.4.0" } }, + "node_modules/@oxc-project/types": { + "version": "0.147.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.147.0.tgz", + "integrity": "sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, "node_modules/@paunovic/random-words": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@paunovic/random-words/-/random-words-1.2.1.tgz", @@ -3745,6 +3757,268 @@ "url": "https://opencollective.com/immer" } }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.6.tgz", + "integrity": "sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.6.tgz", + "integrity": "sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.6.tgz", + "integrity": "sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.6.tgz", + "integrity": "sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.6.tgz", + "integrity": "sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.6.tgz", + "integrity": "sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.6.tgz", + "integrity": "sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.6.tgz", + "integrity": "sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.6.tgz", + "integrity": "sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.6.tgz", + "integrity": "sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.6.tgz", + "integrity": "sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.6.tgz", + "integrity": "sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.6.tgz", + "integrity": "sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.6.tgz", + "integrity": "sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.6.tgz", + "integrity": "sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -6026,6 +6300,17 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -6098,6 +6383,13 @@ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", "license": "MIT" }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -6775,38 +7067,151 @@ } } }, - "node_modules/@wallet-standard/base": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@wallet-standard/base/-/base-1.1.0.tgz", - "integrity": "sha512-DJDQhjKmSNVLKWItoKThJS+CsJQjR9AOBOirBVT1F9YpRyC9oYHE+ZnSf8y8bxUphtKqdQMPVQ2mHohYdRvDVQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=16" + "node_modules/@vitest/expect": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.11.tgz", + "integrity": "sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/@wallet-standard/features": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@wallet-standard/features/-/features-1.1.0.tgz", - "integrity": "sha512-hiEivWNztx73s+7iLxsuD1sOJ28xtRix58W7Xnz4XzzA/pF0+aicnWgjOdA10doVDEDZdUuZCIIqG96SFNlDUg==", - "license": "Apache-2.0", + "node_modules/@vitest/mocker": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.11.tgz", + "integrity": "sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@wallet-standard/base": "^1.1.0" + "@vitest/spy": "4.1.11", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" }, - "engines": { - "node": ">=16" + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/@walletconnect/core": { - "version": "2.11.2", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.11.2.tgz", - "integrity": "sha512-bB4SiXX8hX3/hyBfVPC5gwZCXCl+OPj+/EDVM71iAO3TDsh78KPbrVAbDnnsbHzZVHlsMohtXX3j5XVsheN3+g==", - "license": "Apache-2.0", + "node_modules/@vitest/pretty-format": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.11.tgz", + "integrity": "sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==", + "dev": true, + "license": "MIT", "dependencies": { - "@walletconnect/heartbeat": "1.2.1", - "@walletconnect/jsonrpc-provider": "1.0.13", - "@walletconnect/jsonrpc-types": "1.0.3", - "@walletconnect/jsonrpc-utils": "1.0.8", - "@walletconnect/jsonrpc-ws-connection": "1.0.14", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.11.tgz", + "integrity": "sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.11", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.11.tgz", + "integrity": "sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "@vitest/utils": "4.1.11", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.11.tgz", + "integrity": "sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.11.tgz", + "integrity": "sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.11", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@wallet-standard/base": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/base/-/base-1.1.0.tgz", + "integrity": "sha512-DJDQhjKmSNVLKWItoKThJS+CsJQjR9AOBOirBVT1F9YpRyC9oYHE+ZnSf8y8bxUphtKqdQMPVQ2mHohYdRvDVQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/features": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/features/-/features-1.1.0.tgz", + "integrity": "sha512-hiEivWNztx73s+7iLxsuD1sOJ28xtRix58W7Xnz4XzzA/pF0+aicnWgjOdA10doVDEDZdUuZCIIqG96SFNlDUg==", + "license": "Apache-2.0", + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@walletconnect/core": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.11.2.tgz", + "integrity": "sha512-bB4SiXX8hX3/hyBfVPC5gwZCXCl+OPj+/EDVM71iAO3TDsh78KPbrVAbDnnsbHzZVHlsMohtXX3j5XVsheN3+g==", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-provider": "1.0.13", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/jsonrpc-ws-connection": "1.0.14", "@walletconnect/keyvaluestorage": "^1.1.1", "@walletconnect/logger": "^2.0.1", "@walletconnect/relay-api": "^1.0.9", @@ -7571,6 +7976,16 @@ "license": "MIT", "peer": true }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/ast-types-flow": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", @@ -8267,6 +8682,16 @@ "node": ">=20" } }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -9185,6 +9610,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -9705,6 +10137,16 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -9750,6 +10192,16 @@ "safe-buffer": "^5.1.1" } }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/exponential-backoff": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", @@ -10030,6 +10482,21 @@ } } }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -12024,9 +12491,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", "funding": [ { "type": "github", @@ -12406,6 +12873,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obug": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz", + "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/ofetch": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.5.1.tgz", @@ -12571,6 +13052,13 @@ "dev": true, "license": "MIT" }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/pbkdf2": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.5.tgz", @@ -12671,9 +13159,9 @@ } }, "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "version": "8.5.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", + "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", "dev": true, "funding": [ { @@ -12691,7 +13179,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.11", + "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -13474,6 +13962,40 @@ "node": ">= 16" } }, + "node_modules/rolldown": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.6.tgz", + "integrity": "sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.147.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.6", + "@rolldown/binding-android-arm64": "1.2.6", + "@rolldown/binding-darwin-arm64": "1.2.6", + "@rolldown/binding-darwin-x64": "1.2.6", + "@rolldown/binding-freebsd-x64": "1.2.6", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.6", + "@rolldown/binding-linux-arm64-gnu": "1.2.6", + "@rolldown/binding-linux-arm64-musl": "1.2.6", + "@rolldown/binding-linux-ppc64-gnu": "1.2.6", + "@rolldown/binding-linux-s390x-gnu": "1.2.6", + "@rolldown/binding-linux-x64-gnu": "1.2.6", + "@rolldown/binding-linux-x64-musl": "1.2.6", + "@rolldown/binding-openharmony-arm64": "1.2.6", + "@rolldown/binding-win32-arm64-msvc": "1.2.6", + "@rolldown/binding-win32-x64-msvc": "1.2.6" + } + }, "node_modules/rpc-websockets": { "version": "9.3.3", "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.3.tgz", @@ -13911,6 +14433,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -14002,6 +14531,13 @@ "dev": true, "license": "MIT" }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, "node_modules/stackblur-canvas": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", @@ -14022,6 +14558,13 @@ "node": ">= 0.6" } }, + "node_modules/std-env": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "dev": true, + "license": "MIT" + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -14413,15 +14956,32 @@ "integrity": "sha512-fGTi3gxV/23FTYdAoUtLYp6qySe2KE3teyZitipKNRuVYcBkoP/bB3guXN/XVKUe9mxCHXnc9C4ocyz8OmgN0g==", "license": "MIT" }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz", + "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" @@ -14449,9 +15009,9 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, "license": "MIT", "engines": { @@ -14461,6 +15021,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/tinyrainbow": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz", + "integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-buffer": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", @@ -15191,6 +15761,461 @@ "d3-timer": "^3.0.1" } }, + "node_modules/vite": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.2.tgz", + "integrity": "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.26", + "rolldown": "~1.2.4", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.4.0 || ^0.5.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/vite/node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/vitest": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.11.tgz", + "integrity": "sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.11", + "@vitest/mocker": "4.1.11", + "@vitest/pretty-format": "4.1.11", + "@vitest/runner": "4.1.11", + "@vitest/snapshot": "4.1.11", + "@vitest/spy": "4.1.11", + "@vitest/utils": "4.1.11", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.11", + "@vitest/browser-preview": "4.1.11", + "@vitest/browser-webdriverio": "4.1.11", + "@vitest/coverage-istanbul": "4.1.11", + "@vitest/coverage-v8": "4.1.11", + "@vitest/ui": "4.1.11", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -15317,6 +16342,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wif": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/wif/-/wif-5.0.0.tgz", @@ -15522,10 +16564,9 @@ } }, "node_modules/zod": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", - "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", - "dev": true, + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.5.4.tgz", + "integrity": "sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/frontend/src/lib/notification-store.test.ts b/frontend/src/lib/notification-store.test.ts index 5d3d900..5e8029f 100644 --- a/frontend/src/lib/notification-store.test.ts +++ b/frontend/src/lib/notification-store.test.ts @@ -1,4 +1,4 @@ -import { afterEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { BROADCAST_USER_ID, @@ -7,15 +7,39 @@ import { listNotifications, markAllAsRead, markAsRead, + pruneExpiredNotifications, resetNotificationStore, subscribe, } from "@/lib/notification-store"; describe("notification-store", () => { + beforeEach(() => { + vi.stubEnv("NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS", "36500"); + }); + afterEach(() => { + vi.unstubAllEnvs(); resetNotificationStore(); }); + it("uses the configured retention window for historical notifications", () => { + vi.stubEnv("NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS", "1"); + const now = new Date("2026-08-30T12:00:00.000Z"); + createNotification( + { userId: "alice", type: "bounty_created", title: "Expired", message: "m" }, + new Date("2026-08-28T12:00:00.000Z"), + ); + createNotification( + { userId: "alice", type: "bounty_created", title: "Still active", message: "m" }, + now, + ); + + pruneExpiredNotifications(now); + + expect(listNotifications("alice")).toHaveLength(1); + expect(listNotifications("alice")[0].title).toBe("Still active"); + }); + it("creates a notification with an incrementing id and unread by default", () => { const a = createNotification({ userId: "alice", @@ -130,4 +154,22 @@ describe("notification-store", () => { expect(listener).toHaveBeenCalledTimes(1); }); + + it("prunes expired notifications automatically", () => { + vi.stubEnv("NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS", "1"); + + createNotification( + { userId: "alice", type: "bounty_created", title: "Expired", message: "old" }, + new Date("2026-08-28T12:00:00.000Z"), + ); + createNotification( + { userId: "alice", type: "bounty_created", title: "Still active", message: "new" }, + new Date("2026-08-29T12:00:00.000Z"), + ); + + pruneExpiredNotifications(new Date("2026-08-30T12:00:00.000Z")); + + expect(listNotifications("alice")).toHaveLength(1); + expect(listNotifications("alice")[0].title).toBe("Still active"); + }); }); diff --git a/frontend/src/lib/notification-store.ts b/frontend/src/lib/notification-store.ts index b3172ed..4a07371 100644 --- a/frontend/src/lib/notification-store.ts +++ b/frontend/src/lib/notification-store.ts @@ -10,6 +10,23 @@ export const BROADCAST_USER_ID = "*"; const notifications = new Map(); let nextId = 1; +const DEFAULT_NOTIFICATION_RETENTION_DAYS = 30; + +function readRetentionDays(envKey: string, fallback: number): number { + const raw = process.env?.[envKey]; + const value = Number(raw ?? ""); + return Number.isFinite(value) && value > 0 ? value : fallback; +} + +export function getNotificationRetentionDays(): number { + return readRetentionDays( + "NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS", + DEFAULT_NOTIFICATION_RETENTION_DAYS, + ); +} + +export const NOTIFICATION_RETENTION_DAYS = getNotificationRetentionDays(); + // EventEmitter powers both the SSE stream and any in-process subscribers. // Raised to avoid MaxListenersExceededWarning when many clients connect. const emitter = new EventEmitter(); @@ -21,6 +38,30 @@ function isForUser(record: NotificationRecord, userId: string): boolean { return record.userId === userId || record.userId === BROADCAST_USER_ID; } +function isExpiredNotification(record: NotificationRecord, now: Date): boolean { + const createdAt = Date.parse(record.createdAt); + if (!Number.isFinite(createdAt)) { + return false; + } + + const cutoff = + now.getTime() - getNotificationRetentionDays() * 24 * 60 * 60 * 1000; + return createdAt < cutoff; +} + +export function pruneExpiredNotifications(now: Date = new Date()): number { + let removed = 0; + + for (const [id, record] of notifications.entries()) { + if (isExpiredNotification(record, now)) { + notifications.delete(id); + removed += 1; + } + } + + return removed; +} + /** * Create a notification and publish it to any live subscribers. * `userId` may be a specific wallet address or `BROADCAST_USER_ID` ("*") @@ -30,6 +71,8 @@ export function createNotification( input: CreateNotificationInput, now: Date = new Date(), ): NotificationRecord { + pruneExpiredNotifications(now); + const record: NotificationRecord = { id: String(nextId++), userId: input.userId, @@ -50,12 +93,16 @@ export function createNotification( /** List notifications for a user (specific + broadcast), newest first. */ export function listNotifications(userId: string): NotificationRecord[] { + pruneExpiredNotifications(new Date()); + return Array.from(notifications.values()) .filter((record) => isForUser(record, userId)) .sort((a, b) => b.createdAt.localeCompare(a.createdAt)); } export function getUnreadCount(userId: string): number { + pruneExpiredNotifications(new Date()); + let count = 0; for (const record of notifications.values()) { if (isForUser(record, userId) && !record.read) { @@ -69,6 +116,8 @@ export function markAsRead( userId: string, notificationId: string, ): NotificationRecord | null { + pruneExpiredNotifications(new Date()); + const record = notifications.get(notificationId); if (!record || !isForUser(record, userId)) { return null; @@ -84,6 +133,8 @@ export function markAsRead( } export function markAllAsRead(userId: string): number { + pruneExpiredNotifications(new Date()); + let updatedCount = 0; for (const [id, record] of notifications.entries()) { if (isForUser(record, userId) && !record.read) { diff --git a/frontend/src/lib/task-listing.test.ts b/frontend/src/lib/task-listing.test.ts index 7532725..af1165f 100644 --- a/frontend/src/lib/task-listing.test.ts +++ b/frontend/src/lib/task-listing.test.ts @@ -1,6 +1,13 @@ -import { afterEach, describe, expect, it } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { createTask, listTasks, resetTaskWorkflowStore } from "@/lib/task-workflow"; +import { + approveSubmission, + createTask, + listTasks, + pruneExpiredTaskRecords, + resetTaskWorkflowStore, + submitTaskWork, +} from "@/lib/task-workflow"; function futureDeadline(offsetSeconds: number) { return Math.floor(Date.now() / 1000) + offsetSeconds; @@ -54,7 +61,12 @@ function seedTasks() { } describe("listTasks", () => { + beforeEach(() => { + vi.stubEnv("NEXT_PUBLIC_TASK_RETENTION_DAYS", "36500"); + }); + afterEach(() => { + vi.unstubAllEnvs(); resetTaskWorkflowStore(); }); @@ -251,4 +263,63 @@ describe("listTasks", () => { expect(result.tasks).toHaveLength(10); expect(elapsedMs).toBeLessThan(200); }); + + it("removes inactive tasks once their retention window has expired", async () => { + vi.stubEnv("NEXT_PUBLIC_TASK_RETENTION_DAYS", "1"); + + const oldTaskResult = createTask( + { + poster: "GPOSTER", + title: "Old completed bounty", + description: "This should be cleaned up after retention.", + reward: 1_000_000, + deadline: futureDeadline(86_400), + maxSubmissions: 1, + }, + new Date("2026-08-28T00:00:00.000Z"), + ); + expect(oldTaskResult.ok).toBe(true); + if (!oldTaskResult.ok) return; + + const activeTaskResult = createTask( + { + poster: "GPOSTER2", + title: "Active bounty", + description: "This should remain visible.", + reward: 2_000_000, + deadline: futureDeadline(86_400), + maxSubmissions: 1, + }, + new Date("2026-08-30T00:00:00.000Z"), + ); + expect(activeTaskResult.ok).toBe(true); + if (!activeTaskResult.ok) return; + + const submissionResult = submitTaskWork( + { + taskId: oldTaskResult.task.id, + contributor: "CONTRIB", + description: "Done", + }, + [], + new Date("2026-08-28T12:00:00.000Z"), + ); + + expect(submissionResult.ok).toBe(true); + if (!submissionResult.ok) return; + + const approved = approveSubmission( + oldTaskResult.task.id, + submissionResult.submission.id, + oldTaskResult.task.poster, + new Date("2026-08-28T13:00:00.000Z"), + ); + expect(approved.ok).toBe(true); + + pruneExpiredTaskRecords(new Date("2026-08-30T12:00:00.000Z")); + + const remaining = listTasks(); + expect(remaining.total).toBe(1); + expect(remaining.tasks[0].title).toBe("Active bounty"); + }); }); diff --git a/frontend/src/lib/task-workflow.ts b/frontend/src/lib/task-workflow.ts index e1a3337..beaef30 100644 --- a/frontend/src/lib/task-workflow.ts +++ b/frontend/src/lib/task-workflow.ts @@ -41,10 +41,75 @@ const taskSubmissions = new Map(); const contributorSubmissions = new Map>(); const comments = new Map(); +const DEFAULT_TASK_RETENTION_DAYS = 180; + +function readRetentionDays(envKey: string, fallback: number): number { + const raw = process.env?.[envKey]; + const value = Number(raw ?? ""); + return Number.isFinite(value) && value > 0 ? value : fallback; +} + +export function getTaskRetentionDays(): number { + return readRetentionDays( + "NEXT_PUBLIC_TASK_RETENTION_DAYS", + DEFAULT_TASK_RETENTION_DAYS, + ); +} + +export const TASK_RETENTION_DAYS = getTaskRetentionDays(); + let nextTaskId = 1; let nextSubmissionId = 1; let nextCommentId = 1; +function isFinalizedTask(task: TaskRecord): boolean { + return task.status === "completed" || task.status === "cancelled" || task.status === "disputed"; +} + +function isExpiredTaskRecord(task: TaskRecord, now: Date): boolean { + if (!isFinalizedTask(task)) { + return false; + } + + const createdAt = Date.parse(task.createdAt); + if (!Number.isFinite(createdAt)) { + return false; + } + + const cutoff = now.getTime() - getTaskRetentionDays() * 24 * 60 * 60 * 1000; + return createdAt < cutoff; +} + +export function pruneExpiredTaskRecords(now: Date = new Date()): number { + let removed = 0; + + for (const [taskId, task] of tasks.entries()) { + if (!isExpiredTaskRecord(task, now)) { + continue; + } + + tasks.delete(taskId); + taskSubmissions.delete(taskId); + contributorSubmissions.delete(taskId); + + for (const [submissionId, submission] of submissions.entries()) { + if (submission.taskId === taskId) { + submissions.delete(submissionId); + } + } + + for (const [commentId, comment] of comments.entries()) { + if (comment.taskId === taskId) { + comments.delete(commentId); + } + } + + removed += 1; + } + + return removed; +} + function validateCreateTaskInput(input: CreateTaskInput, nowSeconds: number): string[] { const errors: string[] = []; @@ -83,6 +148,8 @@ export function createTask( input: CreateTaskInput, now: Date = new Date(), ): WorkflowResult<{ task: TaskRecord }> { + pruneExpiredTaskRecords(now); + const nowSeconds = Math.floor(now.getTime() / 1000); const errors = validateCreateTaskInput(input, nowSeconds); @@ -136,6 +203,8 @@ export function createTask( } export function getTask(taskId: string): WorkflowResult<{ task: TaskRecord }> { + pruneExpiredTaskRecords(new Date()); + const task = tasks.get(taskId); if (!task) { @@ -155,6 +224,8 @@ export function getTask(taskId: string): WorkflowResult<{ task: TaskRecord }> { * filter state changes. */ export function listTasks(query: ListTasksQuery = {}): ListTasksResult { + pruneExpiredTaskRecords(new Date()); + const search = query.search?.trim().toLowerCase(); const technology = query.technology?.trim().toLowerCase(); const organization = query.organization?.trim().toLowerCase(); From 803a805bea4244bdeef95fcbd6ffb5e3666cfcfb Mon Sep 17 00:00:00 2001 From: ILIYA EMMANUEL Date: Sun, 30 Aug 2026 11:03:34 +0000 Subject: [PATCH 2/4] CI error fixed --- frontend/src/test/regression.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/test/regression.test.ts b/frontend/src/test/regression.test.ts index ae9dd48..888d9c1 100644 --- a/frontend/src/test/regression.test.ts +++ b/frontend/src/test/regression.test.ts @@ -17,6 +17,8 @@ import { describe, expect, it } from "vitest"; +import packageJson from "../../package.json"; + // ============================================================================ // Issue #82: Security Headers Implementation // ============================================================================ @@ -110,7 +112,6 @@ describe("Regression: Issue #83 - Form Accessibility", () => { describe("Regression: Issue #84 - Lint Check Enforcement", () => { it("should have lint script in package.json", () => { // Verifies the lint script exists and is properly configured - const packageJson = require("../../package.json"); expect(packageJson.scripts.lint).toBeDefined(); expect(packageJson.scripts.lint).toBe("eslint"); }); From 64425996b27bffa047a8b168f77650016175efb1 Mon Sep 17 00:00:00 2001 From: ILIYA EMMANUEL Date: Sun, 30 Aug 2026 11:13:16 +0000 Subject: [PATCH 3/4] Fixed the remaining frontend CI test failures. --- frontend/src/lib/form-validation.test.ts | 8 +------- frontend/src/lib/task-submission-e2e.test.ts | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/form-validation.test.ts b/frontend/src/lib/form-validation.test.ts index e741ba5..f3654f9 100644 --- a/frontend/src/lib/form-validation.test.ts +++ b/frontend/src/lib/form-validation.test.ts @@ -34,21 +34,17 @@ import { INVALID_TASK_BAD_TOKEN, INVALID_TASK_EMPTY_DESCRIPTION, INVALID_TASK_EMPTY_TITLE, - INVALID_TASK_PAST_DEADLINE, INVALID_TASK_ZERO_REWARD, INVALID_TASK_ZERO_SUBMISSIONS, INVALID_WORK_SUBMISSION_BAD_CONTRIBUTOR, INVALID_WORK_SUBMISSION_EMPTY_DESCRIPTION, INVALID_WORK_SUBMISSION_EMPTY_URL, INVALID_WORK_SUBMISSION_INVALID_URL, - STANDARD_STELLAR_ADDRESS, VALID_EMAIL, VALID_TASK_DATA, - VALID_TASK_DATA_WITH_OPTIONALS, VALID_WORK_SUBMISSION, - VALID_WORK_SUBMISSION_WITH_CONTRIBUTOR, } from "@/test/mock-data"; -import { futureDeadline, pastDeadline } from "@/test/fixtures"; +import { pastDeadline } from "@/test/fixtures"; // ============================================================================ // validateRequired @@ -763,7 +759,6 @@ describe("validateCreateTaskForm", () => { }); it("accepts valid token address", () => { - const result = validateCreateTaskForm(VALID_TASK_DATA_WITH_OPTIONALS); const result = validateCreateTaskForm({ ...validForm, token: "GABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVW", @@ -844,7 +839,6 @@ describe("validateWorkSubmissionForm", () => { }); it("accepts valid contributor address", () => { - const result = validateWorkSubmissionForm(VALID_WORK_SUBMISSION_WITH_CONTRIBUTOR); const result = validateWorkSubmissionForm({ ...validForm, contributorAddress: "GABCDEFGHIJKLMNOPQRSTUVWXYZ234567ABCDEFGHIJKLMNOPQRSTUVW", diff --git a/frontend/src/lib/task-submission-e2e.test.ts b/frontend/src/lib/task-submission-e2e.test.ts index 28a517a..8458e3c 100644 --- a/frontend/src/lib/task-submission-e2e.test.ts +++ b/frontend/src/lib/task-submission-e2e.test.ts @@ -23,6 +23,7 @@ async function createTaskRequest(overrides: Record = {}) { body: JSON.stringify({ poster: POSTER_ADDRESS, ...VALID_TASK_DATA, + reward: 1_000_000, ...overrides, }), }), From 81067258b3386a60d55789287569b831045143d0 Mon Sep 17 00:00:00 2001 From: ILIYA EMMANUEL Date: Sun, 30 Aug 2026 13:25:00 +0000 Subject: [PATCH 4/4] Fixed the remaining CI failure --- frontend/src/lib/notification-store.test.ts | 9 +++++--- frontend/src/test/regression.test.ts | 25 +++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/frontend/src/lib/notification-store.test.ts b/frontend/src/lib/notification-store.test.ts index 5e8029f..0f592a1 100644 --- a/frontend/src/lib/notification-store.test.ts +++ b/frontend/src/lib/notification-store.test.ts @@ -157,17 +157,20 @@ describe("notification-store", () => { it("prunes expired notifications automatically", () => { vi.stubEnv("NEXT_PUBLIC_NOTIFICATION_RETENTION_DAYS", "1"); + const now = new Date(); + const expiredAt = new Date(now.getTime() - 2 * 24 * 60 * 60 * 1000); + const activeAt = new Date(now.getTime() - 12 * 60 * 60 * 1000); createNotification( { userId: "alice", type: "bounty_created", title: "Expired", message: "old" }, - new Date("2026-08-28T12:00:00.000Z"), + expiredAt, ); createNotification( { userId: "alice", type: "bounty_created", title: "Still active", message: "new" }, - new Date("2026-08-29T12:00:00.000Z"), + activeAt, ); - pruneExpiredNotifications(new Date("2026-08-30T12:00:00.000Z")); + pruneExpiredNotifications(now); expect(listNotifications("alice")).toHaveLength(1); expect(listNotifications("alice")[0].title).toBe("Still active"); diff --git a/frontend/src/test/regression.test.ts b/frontend/src/test/regression.test.ts index 888d9c1..4d7596f 100644 --- a/frontend/src/test/regression.test.ts +++ b/frontend/src/test/regression.test.ts @@ -16,6 +16,8 @@ */ import { describe, expect, it } from "vitest"; +import { existsSync } from "node:fs"; +import path from "node:path"; import packageJson from "../../package.json"; @@ -33,16 +35,18 @@ import packageJson from "../../package.json"; // ============================================================================ describe("Regression: Issue #82 - Security Headers", () => { - it("should have security headers module available", () => { + it("should have security headers module available", async () => { // This test verifies the security headers module exists and can be imported // The actual header value tests are in security-headers.test.ts - expect(() => import("../../../security-headers.mjs")).not.toThrow(); + await expect(import("../../../security-headers.mjs")).resolves.toBeDefined(); }); it("should have security header tests in place", () => { // This test ensures the dedicated security header test file exists // and is being run as part of the test suite - expect(() => import("../lib/security-headers.test.ts")).not.toThrow(); + expect( + existsSync(path.resolve(process.cwd(), "src/lib/security-headers.test.ts")), + ).toBe(true); }); }); @@ -66,14 +70,21 @@ describe("Regression: Issue #82 - Security Headers", () => { describe("Regression: Issue #83 - Form Accessibility", () => { it("should have accessibility tests for TaskFilter component", () => { // Verifies the TaskFilter accessibility test suite exists - expect(() => import("../components/TaskFilter.test.tsx")).not.toThrow(); + expect( + existsSync(path.resolve(process.cwd(), "src/components/TaskFilter.test.tsx")), + ).toBe(true); }); it("should have accessibility tests for WaitlistHeroSection component", () => { // Verifies the WaitlistHeroSection accessibility test suite exists - expect(() => - import("../app/(marketing)/landing/components/WaitlistHeroSection.test.tsx"), - ).not.toThrow(); + expect( + existsSync( + path.resolve( + process.cwd(), + "src/app/(marketing)/landing/components/WaitlistHeroSection.test.tsx", + ), + ), + ).toBe(true); }); it("should prevent duplicate accessibility attributes", () => {