Screen share 13: fluxer-core previews (#160) #239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "screenshare-13-core-previews"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: origin/screenshare-12-core-codec-negotiation
What
fluxer-core::voice::stream::previews(spec §3.6, §6.3 "Previews (sharer)" / "(viewer)"):ApiRequest::UploadStreamPreview { key, channel_id }at once, then every 1 s untilApiResult::StreamPreviewUploadedor 10 attempts (the original'shasUploadedOnce/initialAttempts), then every 4 min ± 60 s while another connection lists the key, otherwise a 5 s idle poll; a first viewer after the bootstrap uploads at once (the original's wake-on-demand). Privacy switch on, stop, leave or move: uploads end at once (the pending timer does nothing).ui.selected_channel(own share excluded) fetched withApiRequest::FetchStreamPreview { key }, refetched every 60 s;ApiResult::StreamPreview { key, found: false }(404) retries every 1 s for the first 10 answers; other failures retry after 60 s.UserAction::RequestStreamPreview(key)(hover) fetches unless in flight or fresh, and a hover within the fresh minute refreshes it when the minute ends. Records of ended streams are dropped.preview_state(&App, &key) -> PreviewState { version, missing };jitter(key, n) -> Duration;upload_delay(key, n); constantsPREVIEW_*.VoiceSettings::disable_stream_previews+VoiceSettingChange::DisableStreamPreviews(bool), stored asdisable_stream_previews(old files load withfalse).Tests
crates/fluxer-core/tests/stream_previews.rs: the plan's 8 tests (written first, seen failing to compile, then passing).FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally. No real-device tests concern this task.Deviations
jitterreturns aDuration, which cannot be negative: it is 0–120 s and the delay is4 min − 60 s + jitter(= 4 min ± 60 s). Deterministic FNV-1a + SplitMix64 over key and upload number (the store has no randomness).404_retries_every_1s_for_10_attemptsis namednot_found_retries_every_1s_for_10_attempts(Rust identifiers cannot start with a digit).ApiResult::StreamPreviewUploadedis a unit variant as in the Interfaces block (one share at most). No in-flight guard on uploads: each turn sends one; the runtime (Screen share 21) should serialise them.VoiceSettings(machine-local, as the file list saysvoice/settings.rs), not in a separate privacy section; parity entries are left to Task 28/29.app.rs(callsreduce_previewsafter the selection reducer),voice/stream/{mod.rs,state.rs}(module +Streams.previews),README.md, andapps/fluxer/src/runtime.rs: a minimal 501CLIENT_NOT_WIREDarm for the two new requests so the exhaustive match compiles, to be replaced by Screen share 21.Closes #160
🤖 Generated with Claude Code
Independent review — Screen share 13 (core previews), commit
c2a4239Scope:
git diff e512205..origin/screenshare-13-core-previews(10 files).Checks
crates/fluxer-core/tests/stream_previews.rsand assert the spec values (10 bootstrap uploads 1000 ms apart ending on first success; 4 min ± 60 s steady only with viewers, jitter deterministic and bounded; 5 s idle poll; privacy switch and stopping the share cancel the pending turn; 60 s viewer refetch for the selected channel's streams; 404 retry every 1 s for 10 answers; hover fetch then refresh).404_retries_every_1s_for_10_attemptsis renamednot_found_retries_every_1s_for_10_attemptsbecause a Rust identifier cannot start with a digit. That rename is fine.ApiRequest::{UploadStreamPreview { key, channel_id }, FetchStreamPreview { key }},ApiResult::{StreamPreviewUploaded, StreamPreview { key, found }},UserAction::RequestStreamPreview(StreamKey),preview_state(&App, &StreamKey) -> PreviewState { version: u64, missing: bool }andjitter(&StreamKey, u64) -> Durationall exist as Task 21/22 consume them. The schedule matches the fork'sStreamPreviewUploadScheduler::decide(checked inStreamPreviewUploadPolicy.ts).clear_streams. The runtime's 501CLIENT_NOT_WIREDstub makes no server call.cargo xtask ciin the review worktree: green (all steps passed; screenshot/livekit steps skipped as not enabled).Findings
jitter()returns 0–120 s, andupload_delaysubtracts 60 s, where the Interfaces block says "in ±60 s".Durationcannot be negative, so the offset is reasonable. The rustdoc states it, and the only consumer isupload_delay. No action needed beyond the doc.disable_stream_previews"in the privacy section". It lives onVoiceSettings(machine-local), which matches the plan's file list (voice/settings.rs). Task 28 needs to show it under Privacy & Safety. This is not blocking.Verdict: APPROVED (no blocking findings, local ci green).