mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
PM-10600: Fix FeatureService service discoverability error
The `IFeatureService` is scoped service, yet it is provided as non-scoped via service provider. This results in exception on runtime. No Android device can register for push notifications as a result.
This commit is contained in:
@ -52,7 +52,9 @@ public class NotificationHubPushRegistrationService : IPushRegistrationService
|
||||
switch (type)
|
||||
{
|
||||
case DeviceType.Android:
|
||||
var featureService = _serviceProvider.GetRequiredService<IFeatureService>();
|
||||
await using (var serviceScope = _serviceProvider.CreateAsyncScope())
|
||||
{
|
||||
var featureService = serviceScope.ServiceProvider.GetRequiredService<IFeatureService>();
|
||||
if (featureService.IsEnabled(FeatureFlagKeys.AnhFcmv1Migration))
|
||||
{
|
||||
payloadTemplate = "{\"message\":{\"data\":{\"type\":\"$(type)\",\"payload\":\"$(payload)\"}}}";
|
||||
@ -67,6 +69,7 @@ public class NotificationHubPushRegistrationService : IPushRegistrationService
|
||||
"\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}";
|
||||
installation.Platform = NotificationPlatform.Fcm;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case DeviceType.iOS:
|
||||
|
Reference in New Issue
Block a user