honk-me 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `honk-me` (npm) are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.1.1] - 2026-10-06
8
+
9
+ ### Fixed
10
+ - Near the deadline, a retry no longer starts with only a few milliseconds left. Such an
11
+ attempt could only time out, and its `HonkTimeoutError` hid the server's real answer (for
12
+ example `503`). A retry now needs at least 250 ms (or `timeoutMs`, when shorter) before
13
+ `deadlineMs`; otherwise the last error is thrown at once.
14
+
15
+ ### Changed
16
+ - Package author: Honk <accounts@honk-me.app>. The README links the Rust SDK, the n8n node
17
+ and the WordPress plugin.
18
+
7
19
  ## [0.1.0] - 2026-10-04
8
20
 
9
21
  ### Added
package/README.md CHANGED
@@ -155,8 +155,9 @@ new Honk({
155
155
  `duplicate: true`, so a lost response never creates a second message.
156
156
  - Only network errors, timeouts, `429` and `5xx` are retried, with exponential backoff and
157
157
  full jitter (`random(0, min(8 s, 0.5 s·2ⁿ))`), never sooner than the server's `Retry-After`.
158
- - Everything stops at `deadlineMs`: if the next wait would cross it (for example a daily quota
159
- that resets at midnight), the error is thrown at once with `retryAfter`.
158
+ - Everything stops at `deadlineMs`: if the next wait, plus time for one more attempt, would
159
+ cross it (for example a daily quota that resets at midnight), the error is thrown at once
160
+ with `retryAfter`.
160
161
  - `4xx` other than `429` are never retried: fix the request instead.
161
162
  - Short per-attempt timeouts; Node's `fetch` keeps connections alive, so create one `Honk`
162
163
  per process and reuse it.
@@ -216,9 +217,11 @@ workflow publishes to npm with provenance (see `CHANGELOG.md`).
216
217
 
217
218
  ## Links
218
219
 
219
- - [honk-me.app](https://honk-me.app): the Honk inbox (web, iPhone).
220
+ - [honk-me.app](https://honk-me.app): the Honk inbox (web, iPhone, Apple Watch).
220
221
  - Other SDKs: [PHP / Laravel](https://github.com/honk-me/honk-php),
221
222
  [Go + CLI](https://github.com/honk-me/honk-go), [Swift](https://github.com/honk-me/honk-swift),
222
- [Kotlin / Java](https://github.com/honk-me/honk-kotlin).
223
+ [Kotlin / Java](https://github.com/honk-me/honk-kotlin), [Rust](https://github.com/honk-me/honk-rust).
224
+ - No code: [n8n node](https://github.com/honk-me/honk-n8n) (`n8n-nodes-honk`) and the
225
+ [WordPress plugin](https://github.com/honk-me/honk-wordpress).
223
226
 
224
227
  MIT License.
@@ -12,6 +12,9 @@ const DEFAULT_RETRIES = 4;
12
12
  const DEFAULT_DEADLINE_MS = 30_000;
13
13
  const DEFAULT_BACKOFF_BASE_MS = 500;
14
14
  const DEFAULT_BACKOFF_MAX_MS = 8_000;
15
+ // A retry starts only with at least this long left before the deadline (or timeoutMs, when
16
+ // shorter): with less it could only time out, and its timeout would hide the real error.
17
+ const MIN_ATTEMPT_MS = 250;
15
18
  /** Seconds from a Retry-After header (delta-seconds or HTTP date), or undefined. */
16
19
  function parseRetryAfter(value, now = Date.now()) {
17
20
  if (value === null)
@@ -120,7 +123,7 @@ class Honk {
120
123
  throw failure;
121
124
  const jitter = Math.random() * Math.min(this.#backoffMax, this.#backoffBase * 2 ** (attempt - 1));
122
125
  const wait = Math.max(jitter, (failure.retryAfter ?? 0) * 1000);
123
- if (Date.now() + wait >= deadline)
126
+ if (Date.now() + wait + Math.min(this.timeoutMs, MIN_ATTEMPT_MS) > deadline)
124
127
  throw failure;
125
128
  await sleep(wait, signal);
126
129
  }
@@ -1 +1 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION = "0.1.1";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Generated from package.json by scripts/build.mjs on every build. Do not edit: change
5
5
  // "version" in package.json instead.
6
- exports.VERSION = '0.1.0';
6
+ exports.VERSION = '0.1.1';
@@ -8,6 +8,9 @@ const DEFAULT_RETRIES = 4;
8
8
  const DEFAULT_DEADLINE_MS = 30_000;
9
9
  const DEFAULT_BACKOFF_BASE_MS = 500;
10
10
  const DEFAULT_BACKOFF_MAX_MS = 8_000;
11
+ // A retry starts only with at least this long left before the deadline (or timeoutMs, when
12
+ // shorter): with less it could only time out, and its timeout would hide the real error.
13
+ const MIN_ATTEMPT_MS = 250;
11
14
  /** Seconds from a Retry-After header (delta-seconds or HTTP date), or undefined. */
12
15
  export function parseRetryAfter(value, now = Date.now()) {
13
16
  if (value === null)
@@ -116,7 +119,7 @@ export class Honk {
116
119
  throw failure;
117
120
  const jitter = Math.random() * Math.min(this.#backoffMax, this.#backoffBase * 2 ** (attempt - 1));
118
121
  const wait = Math.max(jitter, (failure.retryAfter ?? 0) * 1000);
119
- if (Date.now() + wait >= deadline)
122
+ if (Date.now() + wait + Math.min(this.timeoutMs, MIN_ATTEMPT_MS) > deadline)
120
123
  throw failure;
121
124
  await sleep(wait, signal);
122
125
  }
@@ -1 +1 @@
1
- export declare const VERSION = "0.1.0";
1
+ export declare const VERSION = "0.1.1";
@@ -1,3 +1,3 @@
1
1
  // Generated from package.json by scripts/build.mjs on every build. Do not edit: change
2
2
  // "version" in package.json instead.
3
- export const VERSION = '0.1.0';
3
+ export const VERSION = '0.1.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honk-me",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Official Node.js/TypeScript client for Honk (honk-me.app): send events from apps, scripts and automations to your phone, with retries and idempotency built in.",
5
5
  "keywords": [
6
6
  "honk",
@@ -24,7 +24,11 @@
24
24
  "url": "git+https://github.com/honk-me/honk-node.git"
25
25
  },
26
26
  "license": "MIT",
27
- "author": "Honk contributors",
27
+ "author": {
28
+ "name": "Honk",
29
+ "email": "accounts@honk-me.app",
30
+ "url": "https://honk-me.app"
31
+ },
28
32
  "sideEffects": false,
29
33
  "main": "./dist/cjs/index.js",
30
34
  "module": "./dist/esm/index.js",