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