╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │241 // repo's directory rather than the route. │ │242 repo = .{ │ │243 .event = .{ │ │242 - .user_id = "", │ │244 + .user_id = @splat('0'), │ │245 .name = try arena.allocator().dupe(u8, std.Io.Dir.path.basename(local.path)),│ │246 .description = "", │ │247 // local mode shows every tab │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │263 │ │264 // resolve the creating user so the header can show their name to the left │ │265 // of the repo title. │ │264 - const owner = (try evt.User.readById(DB, hash_kind, haxy_moment, arena, repo.event.user_id)) orelse return error.NotFound;│ │266 + owner_id = try evt.parseEventId(&repo.event.user_id); │ │267 + const owner = (try evt.User.readById(DB, hash_kind, haxy_moment, arena, &owner_id)) orelse return error.NotFound; │ │268 owner_name = owner.event.name; │ │269 │ │270 // the repo's working copy lives in its owner's dir. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │271 source = .{ │ │269 - .path = try evt.repoPath(arena.allocator(), users_dir, repo.event.user_id, &found.event_id),│ │272 + .path = try evt.repoPath(arena.allocator(), users_dir, &owner_id, &found.event_id), │ │273 .repo_kind = .xit, │ │274 }; │ │275 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │326 .patch_role = repo.event.patch_role, │ │327 .hash_kind = opened.self_repo_opts.hash, │ │328 .view = if (route == .repo_roles) .roles else .settings, │ │326 - .roles = try Roles.init(io, gpa, arena, session.haxy_moment orelse return error.NoMoment, session.users_dir orelse return error.NoMoment, repo_identity.identity, repo.event.user_id[0..evt.event_id_size], &repo_id, roles_start),│ │329 + .roles = try Roles.init(io, gpa, arena, session.haxy_moment orelse return error.NoMoment, session.users_dir orelse return error.NoMoment, repo_identity.identity, &owner_id, &repo_id, roles_start), │ │330 }; │ │331 } │ │332 // tabs switch in-page, so every tab's data is read here │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │360 if (repo_kind == .xit and session.data.host_kind == .server) { │ │361 // a server page always resolved its repo id │ │362 const repo_id = repo_id_maybe orelse unreachable; │ │360 - readNotify(opened.self_repo_opts, session, arena, opened, repo.event.user_id[0..evt.event_id_size], &repo_id, viewed_thread, &discussions_data, &issues_data, &patches_data) catch |err| {│ │363 + readNotify(opened.self_repo_opts, session, arena, opened, &owner_id, &repo_id, viewed_thread, &discussions_data, &issues_data, &patches_data) catch |err| { │ │364 std.log.warn("failed to read thread notifications: {s}", .{@errorName(err)}); │ │365 }; │ │366 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │295 const DB = evt.EventDB(hash_kind); │ │296 // the parts of a record a row shows │ │297 const Authored = struct { author_email: ?[]const u8 }; │ │298 - const Owned = struct { event: struct { user_id: []const u8 } }; │ │298 + const Owned = struct { event: struct { user_id: [evt.event_id_size * 2]u8 } };│ │299 var item: Item = .{ │ │300 .id = try formatId(arena.allocator(), id), │ │301 .kind = kind, │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │309 .repo => { │ │310 const record = (try evt.readRecordSubset(evt.Repo, Owned, DB, hash_kind, haxy_moment, arena, id)) orelse return null; │ │311 if (admin_moment) |moment| { │ │312 - if (try evt.User.readById(evt.AdminDB, evt.admin_repo_opts.hash, moment, arena, record.event.user_id)) |user| │ │312 + if (try evt.User.readById(evt.AdminDB, evt.admin_repo_opts.hash, moment, arena, &try evt.parseEventId(&record.event.user_id))) |user|│ │313 item.author = .{ .user_name = user.event.name }; │ │314 } │ │315 }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Roles.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │51 var next_start: ?usize = null; │ │52 for (grants) |grant| { │ │53 // the creator owns the repo with or without a grant │ │54 - if (grant.role == .read or std.mem.eql(u8, grant.user_id, owner_id)) continue; │ │55 - const user = (try evt.User.readById(evt.AdminDB, evt.admin_repo_opts.hash, admin_moment, arena, grant.user_id)) orelse continue;│ │54 + const user_id = try evt.parseEventId(&grant.user_id); │ │55 + if (grant.role == .read or std.mem.eql(u8, &user_id, owner_id)) continue; │ │56 + const user = (try evt.User.readById(evt.AdminDB, evt.admin_repo_opts.hash, admin_moment, arena, &user_id)) orelse continue; │ │57 if (user.removed) continue; │ │58 if (skipped < start) { │ │59 skipped += 1; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │373 const io = session.io orelse return error.NotFound; │ │374 const users_dir = session.users_dir orelse return error.NotFound; │ │375 const found = try evt.readRepoByOwnerAndName(io, session.page_arena.child_allocator, session.page_arena, moment, users_dir, pair.owner, pair.name, null) orelse return error.NotFound;│ │376 - return .{ .path = try evt.repoPath(session.page_arena.allocator(), users_dir, found.repo.event.user_id, &found.event_id), .repo_kind = .xit }; │ │376 + return .{ .path = try evt.repoPath(session.page_arena.allocator(), users_dir, &try evt.parseEventId(&found.repo.event.user_id), &found.event_id), .repo_kind = .xit }; │ │377 } │ │378 │ │379 pub const View = struct { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 const record = (try evt.Fork.readById(DB, hash_kind, moment, arena, &fork_id)) orelse continue; │ │135 │ │136 // the target lives in its owner's user repo │ │137 - const owner_id = record.event.repo_user_id[0..evt.event_id_size]; │ │138 - const target = (try evt.readRepoById(io, gpa, arena, users_dir, owner_id, record.event.repo_id[0..evt.event_id_size], session.userId())) orelse continue; │ │137 + const owner_id = try evt.parseEventId(&record.event.repo_user_id); │ │138 + const target = (try evt.readRepoById(io, gpa, arena, users_dir, &owner_id, &try evt.parseEventId(&record.event.repo_id), session.userId())) orelse continue;│ │139 if (target.role == null) continue; │ │140 // patches that are off take their drafts with them │ │141 if (target.repo.event.patch_role == null) continue; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯