You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Now there are two separate cache invalidations in `StreamRegistry`: one
for metadata and another for permissions.
## Changes
Previously the `invalidateStreamCache()` invalidated both caches. Now
there are separate `invalidatePermissionCaches()` and
`invalidateMetadataCache()` methods.
Also changed log level from `debug` to `trace`.
## Future improvements
- If there are multiple instances of `Stream` classes for same
`streamId`, and `setMetadata()` is called for some of the instances, the
metadata is not updated to other instances.
- Maybe `isStreamPublisher` and `isStreamSubscriber` caches could be
positive caches, i.e. cache the value only if result is `true`? We
invalidate cache manually when we find out that an operation fails
because of missing permission (see `MessageFactory#69` and
`messagePipeline#60`). Those are the only places outside of
`StreamRegistry` manual where cache invalidation is done. Therefore we
could encapsulate the caching fully into `StreamRegistry` and also
simplify cache key handing by doing this refactoring.
- The `invalidatePermissionCaches` should invalidate also the
`hasPublicSubscribePermission` cache? (TODO comment in `StreamRegistry`)
0 commit comments