fix(pwa): add mutex around concurrent DataNode.AddData call
Some checks failed
mkdocs / deploy (push) Failing after 37s
Go / build (push) Failing after 2s
Release / release (push) Failing after 2s

Race detector found concurrent writes to DataNode.files map
from download goroutines. Protect with the existing mutex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-21 13:08:17 +00:00
parent 33f82ebda8
commit aec9e598b2
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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) {