Skip to content

fix(darwin): add DidUpdateNotificationState when enabling notifications#433

Open
acouvreur wants to merge 1 commit intotinygo-org:devfrom
acouvreur:add-darwin-enable-notifcation-validation
Open

fix(darwin): add DidUpdateNotificationState when enabling notifications#433
acouvreur wants to merge 1 commit intotinygo-org:devfrom
acouvreur:add-darwin-enable-notifcation-validation

Conversation

@acouvreur
Copy link
Copy Markdown
Contributor

Currently, enabling notifications does not check for errors.

Currently, enabling notifications does not check for errors.
var err error
select {
case err = <-c.notifyChan:
case <-time.NewTimer(10 * time.Second).C:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

time.After is the same but shorter :)

select {
case err = <-c.notifyChan:
case <-time.NewTimer(10 * time.Second).C:
err = errors.New("timeout on EnableNotifications")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you should define the error on the top of the file (the same as errCannotSendWriteWithoutResponse) to avoid allocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants