fix: プッシュ通知の変更が1時間ほど反映されない問題を修正 (#13407)

* fix: プッシュ通知の変更が1時間ほど反映されない問題を修正

* 410 to refresh

* refreshCache
This commit is contained in:
tamaina 2024-02-23 17:19:08 +09:00 committed by GitHub
parent a85fccaeea
commit b8d8b359bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import type { SwSubscriptionsRepository } from '@/models/_.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { MetaService } from '@/core/MetaService.js';
import { DI } from '@/di-symbols.js';
import { PushNotificationService } from '@/core/PushNotificationService.js';
export const meta = {
tags: ['account'],
@ -66,6 +67,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private idService: IdService,
private metaService: MetaService,
private pushNotificationService: PushNotificationService,
) {
super(meta, paramDef, async (ps, me) => {
// if already subscribed
@ -97,6 +99,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
sendReadMessage: ps.sendReadMessage,
});
this.pushNotificationService.refreshCache(me.id);
return {
state: 'subscribed' as const,
key: instance.swPublicKey,