Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: include class in cache key to prevent incorrect cached values #15

Conversation

vazaha-nl
Copy link
Contributor

This is a nice and useful library, unfortunately I discovered it does not always cache the correct value in my specific use case.

In this use case I have different user classes all implementing the Authorizable contract, and policy logic that depends on the user class. As the library does not take the class into account, this can lead to caching of incorrect values, if the models have the same key.

See the added test for an example.

The fix I implemented here is to include the user model class name in the cache key, so it works in all cases.

@geisi
Copy link
Contributor

geisi commented Apr 17, 2024

@vazaha-nl thanks for the PR i want to do some formatting changes can you please enable the Github "Allow edits from maintainers" Feature?

@vazaha-nl
Copy link
Contributor Author

@geisi this feature is already enabled

@geisi geisi merged commit 0780dba into InnoGE:main Apr 17, 2024
16 checks passed
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.

2 participants