nextcloud / nextcloud/server

Distributed caches are always mem caches

Open
#31,787 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: caching integration
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

\OCP\ICacheFactory::createDistributed returns a \OCP\ICache. In practice the objects are always \OCP\IMemcache, similar to createLocking results.

From a static analysis point of view you can't rely on that assumption.

Describe the solution you'd like

Finish https://github.com/nextcloud/server/pull/30072 so the interface returns a more specific type. This is not a backwards compatible change as any code that expected an ICache will still work.

Describe alternatives you've considered

N/a

Additional context

N/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the OCP\ICacheFactory::createDistributed and createLocking entry points, then inspect pull request 30072. Compare the declared return types with the concrete cache interfaces and check the relevant static-analysis or interface tests. Done means the distributed-cache return type is more specific without breaking existing callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.