Skip to content

Document the v4 fire-and-forget breaking change - #71

Closed
freshlogic wants to merge 2 commits into
mainfrom
document-v4-breaking-change
Closed

Document the v4 fire-and-forget breaking change#71
freshlogic wants to merge 2 commits into
mainfrom
document-v4-breaking-change

Conversation

@freshlogic

Copy link
Copy Markdown
Member

Summary

  • Adds a Breaking bullet to the 4.0.0 CHANGELOG entry and an "Upgrading from v3" note to the README intro documenting the fire-and-forget behavior change.
  • Corrects CLAUDE.md's stale test commands (the suite is on node:test, not Mocha) and removes the async dependency dropped in v4.

Why

In v3, seven methods — fetch, fetchAndRefresh, and the semaphore methods consumeLock, expand, releaseLock, reset, and retrieveOrCreate — defaulted a missing callback to a noop, so calling them without a callback was legal and silently discarded errors. In v4 those same calls return a promise, so an error that used to be swallowed becomes an unhandled promise rejection, which terminates the process on Node.js 15 and later.

Verified side-by-side against a live Redis: semaphore.releaseLock(missingKey, 0) with no callback exits cleanly on 3.7.0 and dies with an unhandled rejection on 4.0.0.

The major version bump covers this under semver, but neither the changelog nor the README called it out, and it is exactly the kind of change consumers need to audit their call sites for before upgrading.

Docs only — no code changes.

🤖 Generated with Claude Code

In v3, fetch, fetchAndRefresh, and five semaphore methods defaulted a
missing callback to a noop, so callback-less calls were legal and
silently discarded errors. In v4 those calls return a promise, and an
error that was previously swallowed becomes an unhandled promise
rejection that terminates the process on Node.js 15+. The 4.0.0
changelog entry and README intro now say so.

Also corrects CLAUDE.md's stale Mocha test commands and removes the
async dependency dropped in v4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coveralls

coveralls commented Aug 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30878693243

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1107
Covered Lines: 1107
Line Coverage: 100.0%
Relevant Branches: 316
Covered Branches: 316
Branch Coverage: 100.0%
Branches in Coverage %: Yes
Coverage Strength: 58.21 hits per line

💛 - Coveralls

An awaited callback-less call is correct v4 usage. The dangerous
pattern is omitting the callback and discarding the returned promise —
which every callback-less call written against v3 necessarily is,
because these methods previously returned nothing to await.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@freshlogic freshlogic closed this Aug 4, 2026
@freshlogic
freshlogic deleted the document-v4-breaking-change branch August 4, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants