From aec9e598b27433d2f7c75a01d5a06730c21edf72 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Feb 2026 13:08:17 +0000 Subject: [PATCH] fix(pwa): add mutex around concurrent DataNode.AddData call Race detector found concurrent writes to DataNode.files map from download goroutines. Protect with the existing mutex. Co-Authored-By: Claude Opus 4.6 --- pkg/pwa/pwa.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/pwa/pwa.go b/pkg/pwa/pwa.go index ce7af06..e490b9d 100644 --- a/pkg/pwa/pwa.go +++ b/pkg/pwa/pwa.go @@ -217,7 +217,9 @@ func (p *pwaClient) DownloadAndPackagePWA(pwaURL, manifestURL string, bar *progr if path == "" { path = "index.html" } + mu.Lock() dn.AddData(path, body) + mu.Unlock() // Parse HTML for additional assets if parseHTML && isHTMLContent(resp.Header.Get("Content-Type"), body) {