Skip to content

fix(updateAvailable): stub async cacheRelease and fetchAndStore - #34

Merged
whomwah merged 1 commit into
mainfrom
fix/cache
Jan 12, 2026
Merged

whomwah merged 1 commit into
mainfrom
fix/cache

Conversation

@whomwah

@whomwah whomwah commented Jan 12, 2026

Copy link
Copy Markdown
Owner

This pull request refactors the update checking logic in updateAvailableItem and its related helpers to use async/await instead of fire-and-forget promises. The main goal is to ensure that cache updates and fetch operations complete before proceeding, which improves reliability and testability. The tests have also been updated to reflect the new asynchronous behavior.

Refactoring to use async/await for update checks:

  • Changed updateAvailableItem to be an async function and now awaits _internals.cacheRelease, ensuring that caching completes before continuing (src/helpers/updateAvailable.ts).
  • Updated cacheRelease to be an async function and to await _internals.fetchAndStore, rather than calling it in a fire-and-forget manner, so that update checks are properly awaited (src/helpers/updateAvailable.ts).

Test updates for async changes:

  • Modified all relevant tests to stub cacheRelease and fetchAndStore with async functions returning resolved promises, aligning with the new async behavior (src/helpers/updateAvailable.test.ts). [1] [2] [3] [4]
  • Removed logic in tests that waited for fire-and-forget promises, since update checks are now awaited directly (src/helpers/updateAvailable.test.ts).

@whomwah whomwah self-assigned this Jan 12, 2026
@whomwah
whomwah merged commit d0c9e54 into main Jan 12, 2026
1 check passed
@whomwah
whomwah deleted the fix/cache branch January 12, 2026 09:03
@whomwah

whomwah commented Jan 12, 2026

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.11.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant