Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): fallback for language query #4354

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

UncleSamtoshi
Copy link
Contributor

@UncleSamtoshi UncleSamtoshi commented Apr 24, 2024

  • use empty language when notifictions service returns an error
  • add timeout to notification settings grpc call

@github-actions github-actions bot added the core label Apr 24, 2024
@UncleSamtoshi UncleSamtoshi force-pushed the notification-error-fallback branch from fafac39 to a298a0a Compare April 24, 2024 16:13
@@ -39,6 +39,8 @@ export const checkedToEmailAddress = (
return emailAddress as EmailAddress
}

export const DefaultLanguage = "" as UserLanguageOrEmpty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the default being set the type UserLanguageOrEmpty becomes irrelevant. Perhaps you could find something semantically more meaningful. Or if it's too complicated to untangle we can leave it for another PR.

Looks good otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I fully understand. The DefaultLanguage is used as a fallback in the case of the error, but even in the case there is not an error the notifications service could still return an empty string implying that the mobile application should use the OS system default. It's definitely a little bit of a mess that is a relic of how the mobile application was handling the language.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may make sense to save that refactoring for a separate pr.

@@ -65,6 +64,9 @@ export const NotificationsService = (): INotificationsService => {
const response = await notificationsGrpc.getNotificationSettings(
request,
notificationsGrpc.notificationsMetadata,
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work too, but I don't see a problem with relying on grpc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants