Commit Graph

96 Commits

Author SHA1 Message Date
Laan Tungir
57863fddcd Fix worker unresponsiveness: fire-and-forget cache writes + remove per-event console.log v0.7.93 2026-07-03 06:29:34 -04:00
Laan Tungir
7d500495a7 post.html: comment button now opens post-feed.html like feed.html v0.7.92 2026-07-01 18:55:25 -04:00
Laan Tungir
7da3b7047c Remove debug logging from notifications menu v0.7.91 2026-07-01 17:30:39 -04:00
Laan Tungir
360a4d83db Add debug logging for notification menu items v0.7.90 2026-07-01 16:54:24 -04:00
Laan Tungir
9400508f3e Fix notifications: keep interaction bar detached so only dropdown menu shows v0.7.89 2026-07-01 16:50:21 -04:00
Laan Tungir
7edee38ea1 Add Like/Zap/Nutzap/Comment/Quote to notification dropdown menu via hidden interaction bar v0.7.88 2026-07-01 15:56:16 -04:00
Laan Tungir
1a17bef1ac Implement Phase 1 remaining tasks: notifications append-only, listener leak fix, memory caps
Task 1.2: Append-only rendering for notifications page
- Extracted buildNotificationRow(item) helper from renderNotifications()
- Added prependNotificationRow(item) with sorted insertion by created_at
- addNotificationFromEvent uses prepend when DOM has children

Task 1.3: Fix notification document.click listener leak
- Removed per-row document.addEventListener('click') that leaked on every render
- Added single delegated click listener in main() using .notif-menu-panel class
- Menu panels still close when clicking outside .notif-right

Task 1.4: Cap posts[] and postIds with rolling eviction
- Added MAX_STORED_POSTS=500 constant to feed.html and post.html
- Added prunePostsArray() that sorts, slices, rebuilds postIds/renderedPostIds
- Called in upsertFeedPost/upsertPost with +50 batch threshold
- post.html skips pruning in event mode

Task 1.5: Cap notificationsById/unreadNotificationsById with periodic pruning
- Added MAX_STORED_NOTIFICATIONS=500, MAX_POST_IMAGE_CACHE=200
- Added pruneNotificationMaps() that prunes both Maps and LRU-caps postImageCache
- Called in addNotificationFromEvent, hydrateNotificationsFromCache/Relays

Updated plan checklist marking all Phase 1 tasks complete.
v0.7.87
2026-07-01 09:33:29 -04:00
Laan Tungir
04405da933 Fix feed page dropped posts: out-of-order events and race condition
prependPostCard() now inserts posts in the correct sorted position within
the existing DOM instead of falling back to a full renderFeed() rebuild
when a post is older than the first visible post. This handles relays
that deliver events out of order without wiping the feed.

Also fixed a race condition in fetchFeedWindow: the fire-and-forget
ndkFetchEvents callback was calling renderFeed() after bootstrap
completed, which wiped prepended live posts and caused concurrent
rebuild races. Now it only calls renderFeed() if the feed hasn't been
rendered yet (renderedPostIds.size === 0).

Same prependPostCard sorted-insert fix applied to post.html.
v0.7.86
2026-07-01 09:22:33 -04:00
Laan Tungir
ee0077063d Implement append-only rendering for feed and post pages (task 1.1)
Split renderFeed() into full rebuild + prependPostCard() on both feed.html
and post.html. New live events now prepend a single card at the top of the
feed without rebuilding existing cards, eliminating O(n) DOM rebuilds on
every incoming event. DOM is trimmed to displayCount on overflow with
renderedPostIds kept in sync. Full rebuild path preserved for See More,
mute removal, bootstrap completion, and event mode.

Also added implementation checklist to plans/long-running-memory-bloat-fix.md.
v0.7.85
2026-07-01 07:59:39 -04:00
Laan Tungir
b09bf0d839 Fix ReferenceError: move publishStartTime to outer scope so silent failure detection can access it v0.7.84 2026-06-30 11:36:36 -04:00
Laan Tungir
d04844cce8 Detect silent relay failures: after each batch, mark relays with no response as timed out (catches DNS errors, connection refused, HTTP handshake failures that NDK doesn't emit relay:publish:failed for) v0.7.83 2026-06-30 11:24:45 -04:00
Laan Tungir
b03b848909 Add debug logging: per-relay publish/timeout/reject with elapsed time, batch start/end timing v0.7.82 2026-06-30 11:07:27 -04:00
Laan Tungir
9b746838c3 Fix batch info in footer: include batchCurrent/batchTotal in per-relay progress events, set currentBatch before each batch starts v0.7.81 2026-06-30 10:55:04 -04:00
Laan Tungir
978e5029f3 Skip-mark timed-out broadcast relays too (not just explicit rejections) — reason distinguishes 'publish-timeout' from 'publish-rejected' v0.7.80 2026-06-30 10:42:12 -04:00
Laan Tungir
011e4c303c Show batch progress in footer: '📡 50/630 relays · 2/25 batches · relay.example.com' v0.7.79 2026-06-30 10:36:42 -04:00
Laan Tungir
fa019fe9a1 Send publish response after outbox relays complete, then run broadcast batches in background — composer clears immediately while broadcast continues v0.7.78 2026-06-30 10:33:14 -04:00
Laan Tungir
0f31e1c301 Batched broadcast publishing: split 600+ relays into batches of 25, publish sequentially to avoid browser WebSocket connection limits. 10s per-relay timeout per batch. v0.7.77 2026-06-30 10:21:55 -04:00
Laan Tungir
c9a20e63b5 Keep broadcast result in footer until next publish overwrites it (remove 10s auto-clear) v0.7.76 2026-06-30 10:13:46 -04:00
Laan Tungir
79e38b8f79 Experiment: increase per-relay broadcast timeout to 60s to test if NDK can handle 600 relays with longer connection time v0.7.75 2026-06-30 10:11:08 -04:00
Laan Tungir
7cfd43b91b Set per-relay broadcast timeout to 5s, overall deadline to totalRelays*5s (min 30s). NDK runs relays in parallel so 600 relays finish in ~5s not 3000s v0.7.74 2026-06-30 10:06:37 -04:00
Laan Tungir
777ab312a5 Fix broadcast timeout: increase connection timeout to 15s for temporary relays, race publish against 45s overall deadline so one slow relay doesn't block v0.7.73 2026-06-30 10:02:00 -04:00
Laan Tungir
2763dd9d6a Add relay URL hover tooltip on post time: shows 'Published to N relays:' with URL list when hovering over the relay count v0.7.72 2026-06-30 09:37:36 -04:00
Laan Tungir
a20b28cd21 Fix relay count display: emit broadcastProgress done event for all publishes (not just broadcasts), add missing eventId/eventKind to broadcast done event v0.7.71 2026-06-30 09:33:08 -04:00
Laan Tungir
456f0e1f2e Add relay count to post time display: shows '21r - 1h' format on each post card, tracking successful relay count from broadcastProgress events v0.7.70 2026-06-30 09:28:38 -04:00
Laan Tungir
4abb4bf33c Add 10-sat fee-reserve buffer to handleWalletPayInvoice melt to fix 'not enough inputs provided for melt' errors v0.7.69 2026-06-30 09:19:30 -04:00
Laan Tungir
7dcfc7c3e3 Fix broadcast relay timeout: use 30s timeout for large broadcasts, distinguish timeouts from explicit rejections, only skip-mark explicit rejections, use live-tracked sets for results v0.7.68 2026-06-30 09:15:02 -04:00
Laan Tungir
07f5f39f35 Add per-mint tracing logs to handleWalletPayInvoice for lightning zap diagnostics v0.7.67 2026-06-30 07:59:52 -04:00
Laan Tungir
10ddda633c Add broadcast relays feature: kind 10088 list with always-on union, persistent skip-marks, live progress in post.html footer, sidenav management UI on relays.html v0.7.66 2026-06-30 07:47:22 -04:00
Laan Tungir
c55a5ebfd8 Self-host GPT-2 model files to fix CORS over Tor/onion origins v0.7.65 2026-06-28 20:46:57 -04:00
Laan Tungir
b6e945f8de Use locally-hosted GPT-2 model to fix CORS over Tor/onion origins v0.7.64 2026-06-28 20:45:25 -04:00
Laan Tungir
3ec585273f Change 'post on Primal' to 'post on Nostr' in inspiration FAQ v0.7.63 2026-06-28 20:32:50 -04:00
Laan Tungir
0e8229e13e Update inspiration FAQ to reference waxwing's Primal post and the Meteor paper v0.7.62 2026-06-28 20:30:26 -04:00
Laan Tungir
230bd70e07 Change all muted/dimmed text on stego page to regular primary color v0.7.61 2026-06-28 20:27:13 -04:00
Laan Tungir
c36cb4a0fe Replace simple example FAQ with detailed toy-model walkthrough from llm_steganography_explained.md v0.7.60 2026-06-28 20:25:51 -04:00
Laan Tungir
d6b167a50b Expand How It Works into FAQ section with collapsible questions v0.7.59 2026-06-28 20:23:01 -04:00
Laan Tungir
27f4cd6857 Set llm-steganography page to no-login (auth mode none) by default v0.7.58 2026-06-28 20:18:18 -04:00
Laan Tungir
28c8109f8a Add LLM Steganography demo page with GPT-2-based half-splitting entropy coding v0.7.57 2026-06-28 20:17:04 -04:00
Laan Tungir
00e93b2b2f This is a meaningful git commit message v0.7.56 2026-06-27 08:17:42 -04:00
Laan Tungir
2334f742cf Add kind 0 cache query as fallback for profile names in discovered relays — Dexie profiles table may not have all follows, so also query kind 0 events from NDK cache. Add debug log for name resolution count. v0.7.55 2026-06-26 21:51:10 -04:00
Laan Tungir
8c456ec522 Fix discovered relays cache invalidation: add version suffix to cache key so servingNames data is rebuilt after code change v0.7.54 2026-06-26 21:33:34 -04:00
Laan Tungir
e734f33542 Display usernames instead of pubkeys in discovered relays Follows column — query Dexie profiles table for displayName/name, fall back to truncated pubkey if no profile cached v0.7.53 2026-06-26 20:20:37 -04:00
Laan Tungir
6ad2d37a23 Redesign handleGetDiscoveredRelays: use Dexie cache for follows' kind 10002 events instead of ephemeral outbox tracker. Stable relay→follows mapping that only changes when contact list changes. Live connection status from pool. Cache result in worker to avoid re-querying Dexie on every expand. v0.7.52 2026-06-26 13:43:40 -04:00
Laan Tungir
28ce7bce1b Fix discovered relays table: filter out rows with no serving pubkeys, rename 'Sample Follows' to 'Follows', show all follows (not just 3), fix layout wrapping with overflow-x auto and max-height scroll v0.7.51 2026-06-26 13:29:49 -04:00
Laan Tungir
894a163111 Fix relay disappearing: make port.onmessage synchronous (all handlers fire-and-forget). Fix discovered relays serving data: replace broken LRU cache iteration with kind 3 cache query + per-pubkey trackerData.get(). Remove debug logging. v0.7.50 2026-06-26 10:52:01 -04:00
Laan Tungir
efe9d977cd Make warmOutbox handler non-blocking (fire-and-forget) in worker dispatch — trackUsers involves network I/O that was blocking the entire message dispatch loop, starving getRelayData/getRelayStats v0.7.49 2026-06-26 10:27:42 -04:00
Laan Tungir
bff0bca411 Remove redundant warmOutbox calls from ensureLiveFeedSubscription and newAuthors path — NDK.subscribe already calls trackUsers internally, so only the pre-bootstrap warmOutbox is needed. This reduces the outbox event burst that was starving the worker message queue. v0.7.48 2026-06-26 10:17:56 -04:00
Laan Tungir
fee3ffc764 Increase getRelayData/getRelayStats timeout from 5s to 15s — worker is busy processing outbox/NDK events from feed.html warmOutbox, causing message queue delays v0.7.47 2026-06-26 10:14:21 -04:00
Laan Tungir
d49a3e800f Add debug logging to getDiscoveredRelays handler to diagnose why Serving/Sample Follows columns are empty v0.7.46 2026-06-26 10:11:55 -04:00
Laan Tungir
9d9d0f88f5 Remove discovered relays auto-refresh interval — fetch only on manual expand click to prevent worker message queue starvation v0.7.45 2026-06-26 10:08:13 -04:00
Laan Tungir
b11161862a Fix relays.html relay data timeout: separate discovered relays refresh to 15s interval only when expanded, make worker getDiscoveredRelays handler non-blocking (fire-and-forget) to prevent message queue starvation v0.7.44 2026-06-26 09:54:18 -04:00