Skip to content

Report cache write failures reliably - #111

Open
samdark wants to merge 3 commits into
masterfrom
fix-set-write-errors
Open

samdark wants to merge 3 commits into
masterfrom
fix-set-write-errors

Conversation

@samdark

@samdark samdark commented Oct 17, 2026 •

Copy link
Copy Markdown
Member
Q A
Is bugfix? Yes
New feature? No
Breaks BC? No
Fixed issues Extracted from #110

FileCache::set() can report success after a failed permission or expiry update. A write warning can also escape through an application error handler.

Return false when permission or expiry updates fail, and suppress write warnings. The existing cache file format and direct-write behavior remain in place.

This is the first PR in the bugfix stack extracted from #110.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 22:26
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3d7039ae-92f6-4a5c-8f79-d18693a75a26

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The existing concurrency test rejects write failures that the new behavior intentionally reports.

1 open issue
What changed in this PR

This focused bugfix makes FileCache::set() report write failures reliably while preserving the existing cache format and direct-write behavior.

Changes:

  • Require complete writes and suppress write warnings.
  • Return false when permission or expiry updates fail.
  • Add regression tests and a changelog entry.
File Description
tests/​WriteFailureTest.php Tests short writes, warnings, and metadata failures.
src/​FileCache.php Tightens write and metadata success checks.
CHANGELOG.md Documents the failure-reporting fix.

Review effort: Balanced

Comment thread src/FileCache.php
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.68%. Comparing base (0b76110) to head (7cc2068).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #111      +/-   ##
============================================
+ Coverage     91.56%   92.68%   +1.11%     
  Complexity       69       69              
============================================
  Files             1        1              
  Lines           166      164       -2     
============================================
  Hits            152      152              
+ Misses           14       12       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/FileCache.php Outdated
Comment thread tests/WriteFailureTest.php Outdated
Comment thread src/FileCache.php Outdated
@samdark
samdark requested a review from vjik October 23, 2026 08:13
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.

3 participants