╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────╮ │12 enable_ansi: bool = false, │ │13 │ │14 const Self = @This(); │ │15 + │ │16 +pub const name_max_len = 32; │ │17 │ │18 // the subset of a user that's safe to hand to clients│ │19 pub const Safe = struct { │ ╰──────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │42 const name_to_user_id = try DB.HashMap(.read_write).init(name_to_user_id_cursor);│ │43 │ │44 if (event_maybe) |event| { │ │45 + if (event.name.len > name_max_len) return error.NameTooLong; │ │46 + │ │47 // if this event_id already maps to a user with a different name, │ │48 // drop the stale name->id entry first │ │49 if (try event_id_to_user.getCursor(user_key)) |existing_cursor| { │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯