A diet Tap option for handling atproto sync
15

Configure Feed

Select the types of activity you want to include in your feed.

Tap: restore nextID counter on restart to prevent unique constraint errors (#1257)

When Tap restarts, the EventManager loads existing events from the
database but doesn't initialize the nextID counter. This causes new
events to be assigned IDs starting from 0, which collide with existing
database records.

The fix restores the nextID counter as events are loaded, ensuring new
IDs are always greater than any existing database IDs.

Fixes #1253

authored by

Daniel Holmgren and committed by
GitHub
(Jan 6, 2026, 4:16 PM -0600) 4fbce137 25dec43f

+3
+3
cmd/tap/event_manager.go
··· 140 140 eventCacheSize.Set(float64(len(em.cache))) 141 141 em.cacheLk.Unlock() 142 142 143 + maxID := dbEvts[len(dbEvts)-1].ID 144 + em.nextID.Store(uint64(maxID + 1)) 145 + 143 146 for i := range dbEvts { 144 147 em.pendingIDs <- dbEvts[i].ID 145 148 }