Skip to content

fix: do not await cache.set during stale period#8

Merged
sanny-io merged 2 commits intodevfrom
fix/stale-awaiting
Feb 3, 2026
Merged

fix: do not await cache.set during stale period#8
sanny-io merged 2 commits intodevfrom
fix/stale-awaiting

Conversation

@sanny-io
Copy link
Member

@sanny-io sanny-io commented Feb 3, 2026

Summary by CodeRabbit

  • Documentation

    • Added guide describing caching behavior when neither TTL nor stale-while-revalidate parameters are configured, including usage examples and memory considerations
  • Chores

    • Version bump to 1.0.2 across all packages

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR bumps the project version from 1.0.1 to 1.0.2 across root and package workspaces, adds documentation describing "Caching Forever" behavior for entries with neither TTL nor SWR specified, and refactors the cache revalidation error handling logic to use promise chaining instead of async/await.

Changes

Cohort / File(s) Summary
Documentation & Version Updates
README.md, package.json, packages/cache/package.json, packages/config/package.json
Added "Caching Forever" section to README documenting behavior when neither TTL nor SWR is specified. Bumped version to 1.0.2 across root and workspace packages. Reformatted keywords array in packages/cache/package.json to multi-line format.
Cache Plugin Refactoring
packages/cache/src/plugin.ts
Simplified stale entry revalidation error handling by removing async/await wrapper and try/catch block, replacing with .then() callback chaining and a dedicated .catch() handler on the cache.set promise. Maintains async error logging without blocking the returned revalidated result.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/stale-awaiting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sanny-io sanny-io merged commit 18e1693 into dev Feb 3, 2026
1 of 2 checks passed
@sanny-io sanny-io deleted the fix/stale-awaiting branch February 3, 2026 05:36
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