Skip to content

Fix return behavior in failure case - #159

Merged
viceroypenguin merged 1 commit into
mainfrom
fail-remove-bug
Oct 7, 2026
Merged

viceroypenguin merged 1 commit into
mainfrom
fail-remove-bug

Conversation

@viceroypenguin

@viceroypenguin viceroypenguin commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Failed cache loads can be retried after cancellation instead of leaving waiting and later callers with a stale failure.
  • Tests
    • Added coverage for repeated calls after a failed load, including when the cache entry is removed during the initial load.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 609242b1-d71e-4378-b719-ab534f251b38
📥 Commits

Reviewing files that changed from the base of the PR and between 25e08e9 and 3534ae3.

📒 Files selected for processing (7)
  • .editorconfig
  • src/Immediate.Cache.Shared/ApplicationCache.cs
  • tests/Immediate.Cache.FunctionalTests/ApplicationCacheTests.cs
  • tests/Immediate.Cache.FunctionalTests/DelayGetValueCache.cs
  • tests/Immediate.Cache.FunctionalTests/FailingLoadCache.cs
  • tests/Immediate.Cache.FunctionalTests/GetValue.cs
  • tests/Immediate.Cache.FunctionalTests/GetValueCache.cs
💤 Files with no reviewable changes (2)
  • tests/Immediate.Cache.FunctionalTests/DelayGetValueCache.cs
  • tests/Immediate.Cache.FunctionalTests/GetValue.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The cache changes how it handles exceptions from canceled handler loads. Functional tests cover repeated failing calls, including cases where the cached value is removed during or after the initial load.

Changes

Cache load failure handling

Layer / File(s) Summary
Failing-load test fixtures and settings
tests/Immediate.Cache.FunctionalTests/FailingLoadCache.cs, tests/Immediate.Cache.FunctionalTests/GetValue.cs, tests/Immediate.Cache.FunctionalTests/GetValueCache.cs, tests/Immediate.Cache.FunctionalTests/DelayGetValueCache.cs, .editorconfig
Adds a controllable failing-load handler and defines the GetValue handler in its cache file. Removes test suppression attributes and updates analyzer settings.
Canceled-load exception handling and tests
src/Immediate.Cache.Shared/ApplicationCache.cs, tests/Immediate.Cache.FunctionalTests/ApplicationCacheTests.cs
When a handler throws after cancellation, RunHandler continues through its existing retry logic. Tests cover repeated failures with and without removal during the initial load.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3534a

Removed failing loads still complete waiting callers with the expected failure, and later calls can retry. No merge-blocking issue is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: correcting return behavior when cache loading fails. It is concise and relevant to the implementation and tests.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 37634668469

Coverage increased (+0.03%) to 94.055%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 471
Covered Lines: 443
Line Coverage: 94.06%
Coverage Strength: 2.82 hits per line

💛 - Coveralls

@viceroypenguin
viceroypenguin merged commit 128ed8f into main Oct 7, 2026
3 checks passed
@viceroypenguin
viceroypenguin deleted the fail-remove-bug branch October 7, 2026 14:19
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.

GetValue never completes when the handler throws after RemoveValue

2 participants