@particle-academy/fancy-connector-core 0.5.0 → 0.6.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
@@ -6,6 +6,57 @@ All notable changes to `fancy-connector-core` are documented here, in
6
6
  **This package is pre-1.0, so breaking changes land in MINOR releases.** The
7
7
  version number is not a promise it can keep yet; the entries below are.
8
8
 
9
+ ## [0.6.1] - 2026-09-13
10
+
11
+ ### Fixed
12
+
13
+ - **`ConnectorError` declares `attempts` and `idempotent` on its type.** A failed
14
+ call has attached both since 0.5.0, but the class never declared them, so
15
+ TypeScript refused `error.attempts` and the README taught a cast. They are
16
+ `declare` fields: nothing changes at runtime, and an error that did not end a
17
+ call still has no such property. **What to do:** nothing; a cast you added
18
+ still compiles and can go.
19
+
20
+ ## [0.6.0] - 2026-09-13
21
+
22
+ Additive only. **What a consumer must DO: nothing** — see each entry.
23
+
24
+ ### Added
25
+
26
+ - **PHP: the exception a failed call throws now carries `attempts` and
27
+ `idempotent`**, as the TypeScript error has since 0.1.0. `attempts` is every
28
+ failed attempt of the call, in order, as `list<Attempt>`; `idempotent` is
29
+ what the call declared. Without them a PHP host could see *what* failed but
30
+ not whether a timeout went unretried because the connector is not idempotent
31
+ or was retried until the budget ran out — which is the difference between
32
+ *go and look* and *run it again*.
33
+
34
+ Both are `null` on any exception that did not end a call — one you construct
35
+ yourself, one from `HttpErrors::classify()`, and the classified exception
36
+ chained as `getPrevious()`. Deliberately not `[]` / `false`, which would
37
+ claim nothing was tried, or that the connector declared a retry unsafe.
38
+ TypeScript is unchanged: there they stay absent.
39
+
40
+ **What a consumer must DO: nothing.** Both are new trailing, optional
41
+ constructor parameters on `ConnectorException` and
42
+ `ConnectorRateLimitedException`, so existing `new …Exception(...)` calls,
43
+ positional or named, keep working. A subclass of `ConnectorException` that
44
+ declares its own constructor does not need to pass them.
45
+
46
+ ### Changed
47
+
48
+ - **CI now runs `pint --test` on the PHP tree**, and the tree passes it. Pint
49
+ was already a dev dependency and `composer lint` already called it, but no
50
+ workflow did, so three files had drifted (`RenderRules.php`,
51
+ `ServiceDescriptor.php`, `Socialite/SocialiteBridge.php`) — formatting only,
52
+ no behaviour change.
53
+ - **Line endings are pinned to LF in `.gitattributes`.** A Windows clone with
54
+ `core.autocrlf=true` checked every file out as CRLF, which made `pint --test`
55
+ fail on nearly every PHP file locally while CI saw three, and made
56
+ `scripts/vendor.mjs` generate a `_connector/` copy whose bytes depended on
57
+ the machine it ran on. **What a consumer must DO: nothing** — the published
58
+ files were already LF; only a checkout of this repository changes.
59
+
9
60
  ## [0.5.0] - 2026-09-13
10
61
 
11
62
  ### Fixed
@@ -371,6 +422,11 @@ clock; this package is the runtime it is written on.
371
422
  satisfies it with no dependency in either direction and a host that has never
372
423
  heard of a workflow engine can implement it.
373
424
 
374
- [Unreleased]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.2.0...HEAD
425
+ [Unreleased]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.6.0...HEAD
426
+ [0.6.0]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.5.0...v0.6.0
427
+ [0.5.0]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.4.0...v0.5.0
428
+ [0.4.0]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.3.1...v0.4.0
429
+ [0.3.1]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.3.0...v0.3.1
430
+ [0.3.0]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.2.0...v0.3.0
375
431
  [0.2.0]: https://github.com/Particle-Academy/fancy-connector-core/compare/v0.1.0...v0.2.0
376
432
  [0.1.0]: https://github.com/Particle-Academy/fancy-connector-core/releases/tag/v0.1.0
package/README.md CHANGED
@@ -84,11 +84,15 @@ try {
84
84
  error.kind; // the retry primitive
85
85
  error.providerCode; // only where the service declared `providerCodeFrom`
86
86
  error.cause; // the classified error; for a thrown transport, the original below it
87
+ error.attempts; // every failed attempt of the call, in order
88
+ error.idempotent; // what the call declared — "never allowed to retry" vs "retries ran out"
87
89
  }
88
90
  ```
89
91
 
90
92
  PHP is the same: `ConnectorAuthException`, `->status`, `->providerCode`,
91
- `->getPrevious()`. A provider's own error code is read only where its
93
+ `->getPrevious()`, `->attempts`, `->idempotent`. The last two are set only on the
94
+ error a call throws; anywhere else they are absent (TS) or `null` (PHP), never
95
+ `[]` or `false`. A provider's own error code is read only where its
92
96
  `ServiceDescriptor` says where it lives (`providerCodeFrom`) — Bluesky's `error`
93
97
  is a code and Mastodon's `error` is a sentence, so a guess would be wrong in the
94
98
  most plausible way available.