No way to tell which implementation backs a cache store (a driver factory can replace a built-in name)

Open
#869 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Start at laravel-rust-cache-0.2.0/src/cache.rs:228 and trace how Drivers::extend and CacheManager::create resolve stores. Compare exposing the resolved backend with declaring capabilities for custom drivers; the issue leaves that API choice open. Done when packages can reliably determine the resolved store's implementation or required semantics.

Written by the indexing model from the issue text.

Description

A driver factory registered with Drivers::extend takes precedence over the built-in store with the same driver name (CacheManager::create looks up self.drivers first). So a store configured as redis or database may be backed by a custom implementation, and a package has no API to tell which.

That matters for packages whose correctness depends on the store's semantics: an atomic add/increment, a forget that reports whether it removed a live value, and storage shared between processes (one-time tokens, rate limits, locks). Such a package can check the configured StoreConfig variant, but not what will actually serve it, so it has to require an extra "I trust this store" setting for every production store.

Suggestion

One of:

  • a way to ask a resolved Repository (or CacheManager) whether a store is a built-in implementation and which one (Repository::backend() -> Backend::{Memory, Redis, Database, Custom(name)});
  • or a capabilities query (supports_atomic_add, is_shared_between_processes) that custom drivers declare.

Seen on 0.2.0 (laravel-rust-cache-0.2.0/src/cache.rs:228); the same on 0.x.

Dominant language
Rust
Stars
847
Forks
174
Avg merge
5h 40m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from laravel/rust-framework

All issues in laravel/rust-framework

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.