-
Notifications
You must be signed in to change notification settings - Fork 147
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
Conversation
UncleSamtoshi
commented
Apr 24, 2024
•
edited
Loading
edited
- use empty language when notifictions service returns an error
- add timeout to notification settings grpc call
fafac39
to
a298a0a
Compare
@@ -39,6 +39,8 @@ export const checkedToEmailAddress = ( | |||
return emailAddress as EmailAddress | |||
} | |||
|
|||
export const DefaultLanguage = "" as UserLanguageOrEmpty |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 shouldn't we use something similar to https://github.com/GaloyMoney/galoy/blob/main/core/api/src/services/lnd/index.ts#L801 ?
There was a problem hiding this comment.
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.