Describe the bug
In view/html.go, nextImageID is incremented without mutex protection, causing potential race conditions when multiple goroutines process images concurrently.
To reproduce
Search view/html.go for nextImageID usage - if it's a package-level variable incremented without sync protection, concurrent access causes races.
Expected behavior
Use atomic.AddUint32() or protect with mutex.
Additional context
- Good first issue if confirmed
- Race detector would catch this:
go test -race
- Verify with:
grep -n "nextImageID" view/html.go
Suggested fix:
import "sync/atomic"
var nextImageID uint32
// In code:
id := atomic.AddUint32(&nextImageID, 1)
OS
All platforms
Note: Needs verification - issue based on common pattern analysis.
Describe the bug
In view/html.go, nextImageID is incremented without mutex protection, causing potential race conditions when multiple goroutines process images concurrently.
To reproduce
Search view/html.go for nextImageID usage - if it's a package-level variable incremented without sync protection, concurrent access causes races.
Expected behavior
Use atomic.AddUint32() or protect with mutex.
Additional context
go test -racegrep -n "nextImageID" view/html.goSuggested fix:
OS
All platforms
Note: Needs verification - issue based on common pattern analysis.