Skip to content

Audit fixes (2026-09) - #3

Merged
luthermonson merged 1 commit into
mainfrom
fix/audit-2026-09
Sep 11, 2026
Merged

luthermonson merged 1 commit into
mainfrom
fix/audit-2026-09

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Audited KV/cache fixes for cache-laravel. Adopts ephpm_kv_setnx where it was missing (atomic add()/NX/locks), stops reporting OOM writes as success, fixes the incrBy false->0 cast across the copied KvOps, and refreshes docs/CI. Every behavioral change has a test (agent ran the suite green in WSL PHP 8.5).

…cast

Implement Illuminate\Contracts\Cache\LockProvider on EphpmStore, backed by
a new ephpm_kv_setnx-based EphpmLock modelled on Laravel's MemcachedLock.
Acquisition is atomic (setnx under the KV per-shard lock); release is
best-effort because the SAPI has no compare-and-delete/CAS — documented in
code and README, with TTL as the crashed-owner backstop.

Register the cache Repository through the cache manager
($app['cache']->repository($store)) instead of `new Repository($store)`,
so the event dispatcher is attached and CacheHit/CacheMissed/KeyWritten
events fire.

Fix the shared incrBy bug: SapiKvOps cast `(int) ephpm_kv_incr_by(...)`,
turning the "not an integer" false into 0 and masking the error the
KvOpsInterface contract documents as throwing. Capture the raw result and
throw on false.

Add setnx to KvOpsInterface with SapiKvOps + InMemoryKvOps implementations,
and tests for the lock lifecycle, setnx, cache-event dispatch, and the
increment throw path. Bump README current-release references to v0.10.2.
@luthermonson
luthermonson merged commit 19f0acd into main Sep 11, 2026
3 checks passed
@luthermonson
luthermonson deleted the fix/audit-2026-09 branch September 11, 2026 06:46
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