Skip to content

Rename compute keep-awake guard#89

Merged
rtbenfield merged 4 commits into
mainfrom
docs/compute-signal-safety
Jun 12, 2026
Merged

Rename compute keep-awake guard#89
rtbenfield merged 4 commits into
mainfrom
docs/compute-signal-safety

Conversation

@rtbenfield

Copy link
Copy Markdown
Contributor

Clarifies the keep-awake safety behavior in @prisma/compute and renames the scoped guard API away from scale-to-zero terminology.

Changes

  • Public API: Renames ScaleToZeroGuard and ScaleToZeroGuardOptions to KeepAwakeGuard and KeepAwakeGuardOptions, including the source and test filenames.
  • Documentation: Updates README and JSDoc wording to make the AbortSignal behavior explicit: aborting releases the keep-awake guard only and does not cancel the underlying promise or guarded work.
  • Tests: Updates compute package tests to use the new public guard name while preserving existing behavior coverage.

Why

KeepAwakeGuard describes the caller-visible behavior more directly than scale-to-zero terminology. The signal wording is intentionally explicit because the abort signal is a cost safety net for releasing the guard, not a cancellation mechanism for the work being waited on.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dfe28270-a817-4ee6-a474-dcacbdf9c4c5

📥 Commits

Reviewing files that changed from the base of the PR and between 4a508a2 and 3f807ad.

📒 Files selected for processing (4)
  • packages/compute/README.md
  • packages/compute/src/index.ts
  • packages/compute/src/keep-awake-guard.ts
  • packages/compute/tests/keep-awake-guard.test.ts

Summary by CodeRabbit

Documentation

  • Refreshed keep-awake functionality documentation with updated mechanisms, examples, and best practices for preventing application sleep.

Refactor

  • Renamed keep-awake guard from ScaleToZeroGuard to KeepAwakeGuard with corresponding configuration options update.
  • Updated waitUntil function signature to work with new options interface.
  • Updated package exports to reflect API name changes.

Walkthrough

This pull request renames the compute module's keep-awake guard from ScaleToZeroGuard to KeepAwakeGuard, including its options interface ScaleToZeroGuardOptionsKeepAwakeGuardOptions. The implementation documentation was updated to clarify that an AbortSignal releases only the guard without cancelling the underlying work, and waitUntil is reframed as a promise-settled keep-awake mechanism. The barrel export, README examples, and test suite were all updated to reference the renamed class and interface consistently.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: renaming the compute keep-awake guard from ScaleToZeroGuard to KeepAwakeGuard, which is the primary objective across all modified files.
Description check ✅ Passed The description is directly related to the changeset, explaining the renaming of guard API types, documentation updates for AbortSignal behavior, and test updates, all of which align with the actual changes made.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/compute-signal-safety
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch docs/compute-signal-safety

Comment @coderabbitai help to get the list of available commands and usage tips.

@rtbenfield rtbenfield self-assigned this Jun 12, 2026
@rtbenfield rtbenfield marked this pull request as ready for review June 12, 2026 18:15
@rtbenfield

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@rtbenfield rtbenfield merged commit dc06271 into main Jun 12, 2026
8 checks passed
@rtbenfield rtbenfield deleted the docs/compute-signal-safety branch June 12, 2026 19:42
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.

1 participant