╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │52 │ │53 // read one window of an opened repo's issues (filtered to `tag` when set), │ │54 // ordered by creation time (oldest first), starting at the issue │ │55 -// `selected_id` names ("" = the beginning). issues live in the repo's own │ │56 -// xit db, so a git-backed repo has none. │ │55 +// `selected_id` names ("" = the beginning). a local session reads the event│ │56 +// db next to the repo (synced from the events branch on each page build); │ │57 +// a server repo reads its own db. │ │58 pub fn init( │ │59 comptime repo_kind: rp.RepoKind, │ │60 comptime repo_opts: rp.RepoOpts(repo_kind), │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────╮ │61 arena: *std.heap.ArenaAllocator, │ │62 repo: *rp.Repo(repo_kind, repo_opts),│ │63 io: std.Io, │ │64 + is_local: bool, │ │65 identity: []const u8, │ │66 tag: []const u8, │ │67 selected_id: []const u8, │ ╰─────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │76 // (NotFound -> 404); the bare route falls through to an empty listing. │ │77 const strict = rooted or tagged; │ │78 │ │77 - // a local repo's events live in the event db next to it (consumed from the │ │78 - // events branch at startup); a server repo has them consumed into its own │ │79 - // db. a repo with no consumed events has no moment yet. │ │79 + // a repo with no consumed events has no moment yet. │ │80 const gpa = arena.child_allocator; │ │81 - var event_db_maybe = try evt.LocalEventDB(repo_opts.hash).open(io, gpa, repo.core.repo_dir); │ │81 + var event_db_maybe = if (is_local) try evt.LocalEventDB(repo_opts.hash).open(io, gpa, repo.core.repo_dir) else null;│ │82 defer if (event_db_maybe) |*event_db| event_db.deinit(io, gpa); │ │83 const haxy_moment = (if (event_db_maybe) |*event_db| │ │84 evt.currentMomentFromDb(repo_opts.hash, event_db.db) │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────╮ │85 else if (repo_kind == .git) │ │86 return empty │ │87 + else if (is_local) │ │88 + return empty │ │89 else │ │90 evt.currentMoment(repo_opts, repo)) catch {│ │91 if (strict) return error.NotFound; │ ╰───────────────────────────────────────────────────────╯