create-notificationサービスのisMutedの判定がおかしいっぽい?
多分だけど、includingNotificationTypesがnullの場合に判定がおかしくなる?
includingNotificationTypesってそもそもどうしてnullableにしたんだろう
デフォルトのNULLは全許可にしないといけないからたぶんこう
- const isMuted = !profile?.includingNotificationTypes?.includes(type);
+ const isMuted = !(profile?.includingNotificationTypes == null || profile.includingNotificationTypes.includes(type));
includingNotificationTypesってそもそもどうしてnullableにしたんだろう
['follow', 'mention', 'reply',みたいにデフォルトで全部列挙するようにしちゃうと
新しい通知種別が出来たときにそれがオフになってしまう
あー、これホワイトリストだっけ
たぶんスキーマに、通知設定全体が未定義 と この種別の通知については未定義 の両方の概念があったほうが良かったのかなと
notificationTypes?: Record<string, boolean | undefined>;
if (notificationTypes == null) return true;
if (notificationTypes[key] == null) return true;
return notificationTypes[key];
そもそもブラックリスト形式でよかったような気も
excludeNotificationTypes でよかったのかも
直接コミットした(
Most helpful comment
excludeNotificationTypes でよかったのかも