Skip to content

chore(deps): require utopia-php/cache ^8.0 - #1075

Merged
ArnabChatterjee20k merged 1 commit into
mainfrom
chore-cache-8
Nov 17, 2026
Merged

ArnabChatterjee20k merged 1 commit into
mainfrom
chore-cache-8

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Issue / Description

utopia-php/cache 8.0.0 stores empty arrays: save($key, []) used to be refused because adapters checked empty($data), and now it is kept. Empty strings (and '0') are still refused. Consumers such as appwrite-labs/edge want to move to cache 8 so they can cache [] directly, but database's "^6.1.3 || ^7.0" constraint blocks it.

Solution

  • composer.json: "utopia-php/cache": "^8.0" (a single caret range).
  • composer.lock: only utopia-php/cache moves, 6.1.3 to 8.0.0. Nothing else changes.

No code changes. Database does not use anything that cache 7 removed (Cache::legacy(), Feature\Legacy, getGeneration). getLease, saveWithLease, loadVersioned and compareAndSwap are unchanged in 8.

I checked every place that saves to or loads from the cache, to see whether storing [] changes anything:

Place What it does Verdict
src/Database/Cache/Mutation.php:38-42 loadVersioned, a miss is === false Fine
src/Database/Cache/Mutation.php:69 CAS writes ['owners' => $owners], which is never [] even with no owners Fine
src/Database/Cache/Query.php:103-105 find() cache load, a miss is === false || === null, then the shape is checked Fine
src/Database/Cache/Query.php:167 Saves {version, epoch, field, documents}. An empty result gives documents: [] inside a non-empty wrapper, which cache 6/7 already stored Fine
src/Database/Trait/Documents.php:796,798 A missing document is saved as the $empty marker, not [] Fine
src/Database/Trait/Documents.php:922,944 Document slot load/save: is_array on a non-empty {epoch, field, document} wrapper Fine
src/Database/Trait/Documents.php:1005,1047 Collection definition slot load/save, same wrapper shape Fine
src/Database/Trait/Documents.php:705 if ($cached) on the inner document. It is never [], because absence uses the marker. If it ever were [], it is falsy, so the read falls through to the database (a safe miss) Fine
src/Database/Trait/Documents.php:3874,3911-3914 withCache epoch: saves a random hex string, a miss is === false || === null Fine
src/Database/Trait/Documents.php:3932-3938,4035 withCache value: a miss is !== false && !== null. The saved value always comes from encodeCacheValue() (:4049), which wraps it (['value' => ...] or {collection, type, value}), so a callback that returns [] is still saved as a non-empty array Fine

Database never saves a top-level [] and never reads [] as a miss, so cache 8's change does not reach it.

Appwrite already runs database 10.1.x against the monorepo cache that stores []. That backs this up, but CI here is the real check.

Tests

  • No new tests: nothing in database changes.
  • The existing unit and e2e suites in CI now run against cache 8.0.0.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the supported version range for the cache package.

Cache 8.0.0 stores empty arrays. Every value database saves is a
non-empty wrapper array or a non-empty string, and every read checks
=== false/null or is_array, so no code change is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Composer constraint for utopia-php/cache changes from ^6.1.3 || ^7.0 to ^8.0.

Changes: Cache dependency

Layer / File(s) Summary
Update cache version constraint
composer.json
The utopia-php/cache constraint changes to ^8.0.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

Suggested reviewers: loks0n, abnegate

Merge Risk: Minimal · up to bfbd7

This updates the cache library to its next major version without code changes. No concrete regression has been identified, and the change looks safe to merge after the usual CI checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: the composer.json constraint for utopia-php/cache moves to ^8.0. The raw summary confirms that this single dependency constraint is the only change in composer.json, and th…
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: Title check

Explanation

The title names the change: the composer.json constraint for utopia-php/cache moves to ^8.0. The raw summary confirms that this single dependency constraint is the only change in composer.json, and the objectives describe the same bump. The title is specific and matches the main change. The 'chore(deps)' prefix is a conventional commit type and does not affect the match.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8e40c77 and bfbd7fb.

Files ignored due to path filters: 1

  • composer.lock is excluded by !**/*.lock
Files selected for processing: 1

  • composer.json

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

@ArnabChatterjee20k
ArnabChatterjee20k marked this pull request as ready for review November 17, 2026 12:00
@appwrite

appwrite Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The Composer constraint for utopia-php/cache is narrowed to ^8.0, and the lockfile updates the resolved cache package from 6.1.3 to 8.0.0. No database source code is changed.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
composer.json Require utopia-php/cache ^8.0 instead of allowing cache 6.1 and 7.
composer.lock Resolve utopia-php/cache to 8.0.0 and update its package metadata.

Reviewed bfbd7fb · Details · Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot 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.

🟢 Tier S · Looks good to merge. Summary

@ArnabChatterjee20k
ArnabChatterjee20k merged commit fd4a0b1 into main Nov 17, 2026
22 checks passed
@ArnabChatterjee20k
ArnabChatterjee20k deleted the chore-cache-8 branch November 17, 2026 12:05
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