From 90e1134547dd03044ef5ad1e79292e3dd1db13f2 Mon Sep 17 00:00:00 2001 From: minish Date: Fri, 19 Dec 2025 21:37:37 -0500 Subject: [PATCH] chore: update ws client (v1.1.0) --- autopush/client.go | 12 +++++------- go.mod | 2 +- go.sum | 4 ++-- sites/nicopush/client.go | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/autopush/client.go b/autopush/client.go index 8a276c6..817a3cc 100644 --- a/autopush/client.go +++ b/autopush/client.go @@ -109,13 +109,11 @@ func NewAutoPushClient() (ap *AutoPushClient, ch chan Notification) { unregisterChan: make(chan UnregisterResponse), WebSocketClient: websocket.NewWebSocketClient( nil, - func(ws *websocket.WebSocketClient, isReconnecting bool) { - if !isReconnecting { - close(ap.helloChan) - close(ap.notificationChan) - close(ap.registerChan) - close(ap.unregisterChan) - } + func(ws *websocket.WebSocketClient) { + close(ap.helloChan) + close(ap.notificationChan) + close(ap.registerChan) + close(ap.unregisterChan) }, func(ws *websocket.WebSocketClient, payload []byte) { // log.Println("AutoPush Received Message:", string(payload)) diff --git a/go.mod b/go.mod index 0a153d9..1ab6134 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.min.rip/min/webpush-client-go go 1.23.6 require ( - git.min.rip/min/websocket-client-go v1.0.3 + git.min.rip/min/websocket-client-go v1.1.0 github.com/google/uuid v1.6.0 golang.org/x/crypto v0.35.0 golang.org/x/net v0.35.0 diff --git a/go.sum b/go.sum index e1a9950..cf8185f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.min.rip/min/websocket-client-go v1.0.3 h1:6hwxATcLCwnbR4zkytkp298SpL42ZTVIwvP7FIYR030= -git.min.rip/min/websocket-client-go v1.0.3/go.mod h1:us3qS+xrO/uPnJjJOuRDuvTAmM+2cEBpiASJhT5fQao= +git.min.rip/min/websocket-client-go v1.1.0 h1:DG0IVTE/Wp8BerYX+Vu4q6Up1VGk9zCst5nYPX9sH98= +git.min.rip/min/websocket-client-go v1.1.0/go.mod h1:us3qS+xrO/uPnJjJOuRDuvTAmM+2cEBpiASJhT5fQao= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= diff --git a/sites/nicopush/client.go b/sites/nicopush/client.go index 0236efd..78b641c 100644 --- a/sites/nicopush/client.go +++ b/sites/nicopush/client.go @@ -66,7 +66,7 @@ func NewNicoPushClient( // Handshake performs a handshake with the AutoPush server and retrieves a UAID. // The obtained UAID is used for client identification and should be saved. func (c *NicoPushClient) Handshake() (uaid string, err error) { - if err := c.autoPushClient.Connect(autopush.MOZILLA_PUSH_SERVICE, 3, 2, false); err != nil { + if err := c.autoPushClient.Connect(autopush.MOZILLA_PUSH_SERVICE, 3, 2); err != nil { return "", fmt.Errorf("failed to connect autopush server: %v", err) }