diff --git a/packages/backend/src/core/CacheService.ts b/packages/backend/src/core/CacheService.ts index 00d97c7e1d..1fba4f32d0 100644 --- a/packages/backend/src/core/CacheService.ts +++ b/packages/backend/src/core/CacheService.ts @@ -138,7 +138,7 @@ export class CacheService implements OnApplicationShutdown { } @bindThis - private async onUserEvent(body: InternalEventTypes[E]): Promise { + private async onUserEvent(body: InternalEventTypes[E], _: E, isLocal: boolean): Promise { { { { @@ -151,6 +151,16 @@ export class CacheService implements OnApplicationShutdown { this.uriPersonCache.delete(k); } } + if (isLocal) { + await Promise.all([ + this.userProfileCache.delete(body.id), + this.userMutingsCache.delete(body.id), + this.userBlockingCache.delete(body.id), + this.userBlockedCache.delete(body.id), + this.renoteMutingsCache.delete(body.id), + this.userFollowingsCache.delete(body.id), + ]); + } } else { this.userByIdCache.set(user.id, user); for (const [k, v] of this.uriPersonCache.entries) {