server/loop.zig — addFd silently ignores duplicate fd without updating events/udataserver/loop.zig — addFd silently ignores duplicate fd without updating events/udataFile: src/server/loop.zig:38–39
Severity: MEDIUM
Status: ✅ FIXED — addFd now updates events and udata for existing fd entries. Test added. (bug #38 was marked FIXED for duplicate registration, but this is a different issue — updating existing entries)
for (self.fds.items) |f| {
if (f.fd == fd) return;
}
If addFd is called with an fd already in the list (e.g. to update the event mask or user data), it silently returns without updating anything. This can cause stale event masks or stale udata pointers, leading to missed events or dispatching to wrong handlers.