Fix: debounce reorder sign requests, pushState URL updates, proactive subscriptions (fixes #14, #29, #30) - #76
Conversation
…ubscriptions Fixes freenet#14, freenet#29, and freenet#30. Issue freenet#14: swap_page_order now debounces sign requests behind a 500ms timer, coalescing rapid reorder clicks into a single network UPDATE. Prevents held-arrow-key drift from pushing updated_at minutes into the future. Local state updates remain immediate for visual feedback. Issue freenet#29: update_hash now uses history.pushState instead of replaceState, so the address bar IRI updates and back/forward navigation works for page switches. A popstate listener was added to handle browser back/forward button events. Issue freenet#30: Added subscribe_to_known_sites() which fires always-on Subscribe requests for every known site's contract after the current delegate's KnownSites response arrives. Under the demand-driven hosting model (freenet-core#4642), this prevents published sites from being silently GC'd under peer churn. Also updated AGENTS.md to note pushState alongside replaceState in the iframe constraints.
424bb6c to
0a8754e
Compare
|
Reviewed this alongside #75. #75 is merged; this one I cannot merge yet, and I would rather give you the specifics than just decline. The headline: it does not compile for the shipping target.
None of this was your fault to miss: CI had never run on this PR. Fork PRs here wait for maintainer approval, so the WASM build job never executed and you got no signal. That is a process failure on our side and I have approved the workflow. Three things beyond the build, which matter more because they would survive a green CI: 1. The debounce loses writes. *REORDER_PENDING.write() = pages_owned; // overwriteThe comment three lines above says the pages "accumulate ... so a single debounced flush covers the full migration set". The code replaces the vector. Swap A/B, then swap C/D within 500 ms: the second click cancels the first timer and overwrites pending with Same shape: 2. #14's actual harm is not addressed. The 3. The back button gets trapped. The new Related: #29 asks for a copyable, bookmarkable address, and The proactive-subscription idea is sound and its ordering is correct, but it needs a fire-once latch: it sits in the one arm the code documents as firing repeatedly ( Happy to look again whenever you push. Your [AI-assisted - Claude] |
Fixes #14, #29, and #30.
Issue #14:
swap_page_ordernow debounces sign requests behind a 500ms timer, coalescing rapid clicks (e.g. held arrow key at 30 Hz) into a single network UPDATE. Preventsupdated_atdrift from pushing timestamps minutes into the future. Local state updates remain immediate for visual feedback.Issue #29:
update_hashnow useshistory.pushStateinstead ofreplaceState, so the address bar IRI updates and back/forward navigation works for page switches. Apopstatelistener was added to handle browser back/forward events.Issue #30: Added
subscribe_to_known_sites()which fires always-onSubscriberequests for every known site's contract after the current delegate's KnownSites response arrives. Under the demand-driven hosting model (freenet-core#4642), this prevents published sites from being silently GC'd under peer churn.Also updated AGENTS.md to note
pushStatealongsidereplaceStatein the iframe constraints.