From 0f93c1160b28bf54133945b263d183a9b9f9f968 Mon Sep 17 00:00:00 2001 From: Will Pfleger Date: Mon, 6 Jul 2026 18:18:06 -0400 Subject: [PATCH] docs(archive): document mixed row-shape invariant on read_archived_events --- desktop/scripts/check-file-sizes.mjs | 3 ++- desktop/src-tauri/src/archive/mod.rs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop/scripts/check-file-sizes.mjs b/desktop/scripts/check-file-sizes.mjs index fe9856c1b8..6732a460c1 100644 --- a/desktop/scripts/check-file-sizes.mjs +++ b/desktop/scripts/check-file-sizes.mjs @@ -77,7 +77,8 @@ const overrides = new Map([ // lines. Atomic merge to close the concurrent-seed race. Still queued to split. // IMMEDIATE-tx fix: BEGIN IMMEDIATE replaces DEFERRED unchecked_transaction // in merge_owner_p_kinds comment block (~5 lines). Still queued to split. - ["src-tauri/src/archive/mod.rs", 1700], + // doc-comment: mixed row-shape invariant on read_archived_events (~5 lines). + ["src-tauri/src/archive/mod.rs", 1705], // archive/store.rs: merge_owner_p_kinds fn (read+union+upsert under a single // SQLite tx) + 4 unit tests (create-when-none, adds-kind, idempotent, // concurrent-interleave). Load-bearing TOCTOU fix for the owner_p shared row. diff --git a/desktop/src-tauri/src/archive/mod.rs b/desktop/src-tauri/src/archive/mod.rs index 3a96828576..d28c5ef8e1 100644 --- a/desktop/src-tauri/src/archive/mod.rs +++ b/desktop/src-tauri/src/archive/mod.rs @@ -464,6 +464,11 @@ const DEFAULT_READ_LIMIT: i64 = 50; /// /// `kinds` is an optional filter; an empty array means "no kinds matched" /// (not "all kinds") — callers should pass `null`/`None` when they want all. +/// +/// Note: stored row payloads are not uniform — kind 44200 rows store the raw +/// metric payload JSON, while all other kinds store full Nostr Event JSON. A +/// caller doing `Event::from_json` on an unfiltered read must filter by kind +/// first (today's only reader filters `kinds: [24200]`). #[tauri::command] pub fn read_archived_events( state: State<'_, AppState>,