fix(utils): use smartdelay.Timeout for cancellable timeouts and call timeout.cancel() on cleanup; add @git.zone/cli release configuration pointing to Verdaccio registry with public access

This commit is contained in:
2026-02-11 17:20:34 +00:00
parent e207c05dc3
commit bbfd4982a5
4 changed files with 24 additions and 17 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## 2026-02-11 - 4.0.2 - fix(utils)
use smartdelay.Timeout for cancellable timeouts and call timeout.cancel() on cleanup; add @git.zone/cli release configuration pointing to Verdaccio registry with public access
- Replace plugins.smartdelay.delayFor with plugins.smartdelay.Timeout so the timeout exposes a promise and can be cancelled.
- Call timeout.cancel() in the cleanup function to ensure the timer is cancelled when the operation completes and avoid stray aborts.
- Add @git.zone/cli.release entry in npmextra.json configuring the registry (https://verdaccio.lossless.digital) and accessLevel: public for releases.
## 2025-10-20 - 4.0.1 - fix(tests)
Fix tests and documentation: adjust test server routes and expectations, add timeout/fallback routes, and refresh README

View File

@@ -29,5 +29,13 @@
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@git.zone/cli": {
"release": {
"registries": [
"https://verdaccio.lossless.digital"
],
"accessLevel": "public"
}
}
}

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/webrequest',
version: '4.0.1',
version: '4.0.2',
description: 'Modern, fetch-compatible web request library with intelligent HTTP caching, retry strategies, and fault tolerance.'
}

View File

@@ -12,24 +12,16 @@ export function createTimeoutController(timeoutMs: number): {
cleanup: () => void;
} {
const controller = new AbortController();
let timeoutId: any;
// Set up timeout
plugins.smartdelay
.delayFor(timeoutMs)
.then(() => {
controller.abort();
})
.then((result) => {
timeoutId = result;
});
// Use Timeout directly so we can cancel it when the fetch completes
const timeout = new plugins.smartdelay.Timeout(timeoutMs, null);
timeout.promise.then(() => {
controller.abort();
});
// Cleanup function to clear timeout
// Cleanup function to cancel the timeout timer
const cleanup = () => {
if (timeoutId !== undefined) {
// smartdelay doesn't expose a cancel method, so we just ensure
// the controller won't abort if already completed
}
timeout.cancel();
};
return { controller, cleanup };