Skip to content

Commit 915d309

Browse files
committed
Tolerate null agent in /node response
Public seeds return `"agent": null` because their deployed httpd binaries can't parse i2p/onion rows that newer nodes write to the address table — `AddressStore::get` fails and the handler falls back to `None`. Allow null in the zod schema and hide the user-agent row in the UI when it's missing. Workaround until heartwood ships `StoreExt::agent_of` (reads only the `agent` column, no address hydration) and httpd adopts it.
1 parent 7ae8d60 commit 915d309

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

http-client/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export type Node = z.infer<typeof nodeSchema>;
9797

9898
const nodeSchema = z.object({
9999
id: z.string(),
100-
agent: z.string(),
100+
agent: z.string().nullable(),
101101
config: nodeConfigSchema.nullable(),
102102
state: z.union([z.literal("running"), z.literal("stopped")]),
103103
avatarUrl: z.string().optional(),

src/views/nodes/View.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@
166166
<div style:width="2rem"></div>
167167
</Seeding>
168168
</div>
169-
<div class="sidebar-item">
170-
<UserAgent agent={node.agent} />
171-
</div>
169+
{#if node.agent}
170+
<div class="sidebar-item">
171+
<UserAgent agent={node.agent} />
172+
</div>
173+
{/if}
172174
</div>
173175
</div>
174176

0 commit comments

Comments
 (0)