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

Fix for #1050 - User cache not flushed on model save #1051

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- Fix issue with hidden fields in group modal ([#1033])
- User cache not flushed on model save ([#1050])

## [v4.3.1]

Expand Down Expand Up @@ -876,6 +877,7 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x
[#1041]: https://github.com/userfrosting/UserFrosting/issues/1041
[#1042]: https://github.com/userfrosting/UserFrosting/issues/1042
[#1045]: https://github.com/userfrosting/UserFrosting/issues/1045
[#1050]: https://github.com/userfrosting/UserFrosting/issues/1050

[v4.2.0]: https://github.com/userfrosting/UserFrosting/compare/v4.1.22...v4.2.0
[v4.2.1]: https://github.com/userfrosting/UserFrosting/compare/v4.2.0...v.4.2.1
Expand Down
2 changes: 1 addition & 1 deletion app/sprinkles/account/src/Authenticate/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ protected function validateUserAccount($userId)

// Load user from db, cache the result
$key = $this->config['cache.user.key'] . $userId;
$user = $this->cache->remember($key, $this->config['cache.user.delay'], function () use ($userId) {
$user = $this->cache->remember($key, $this->config['cache.user.delay'] * 60, function () use ($userId) {
return $this->classMapper->getClassMapping('user')::find((int) $userId);
});

Expand Down
2 changes: 1 addition & 1 deletion app/sprinkles/account/src/Database/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class User extends Model implements UserInterface
*
* @var array
*/
protected $events = [
protected $dispatchesEvents = [
'saved' => Events\DeleteUserCacheEvent::class,
'deleted' => Events\DeleteUserCacheEvent::class,
];
Expand Down