Skip to content

Stale cached value returned where(...)->first() #453

Open
@aaroncameron

Description

@aaroncameron

Describe the bug
Requesting the first (and unique) result with Model::where(...)->first() returns an old, incorrect result,

Eloquent Query

MyModel::where(['a'=>1,'b'=>2])->first();  // returns an old result

MyModel::where(['a'=>1,'b'=>2])->get()->first(); // returns the correct result.

Environment

  • PHP: 8.1.2
  • OS: Ubuntu 22.04
  • Laravel: 10.15.0
  • Model Caching: 0.13.4

Additional context
That the result in my test case is unique may or may not be relevant. Have not constructed a test where it is not to confirm.

There is in the above a unique key across a,b. The result is not simply coincidentally unique, but is by definition.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions