Commit Graph
3444 Commits
  • refactor(watch): one projection of a watch position and one test for a local move
    "Where is this playback now" was written out four times: watchPosition
    for a room's anchor, and three hand-written copies for a local sample,
    in the owner's and the viewer's look for a move the person made and in
    freezing a source that went away. The local samples now use
    watchPosition with the time they were observed as the anchor. "Did the
    person move it" is decided once for each observation: between two
    paused samples any change of position counts; otherwise a ready sample
    must differ from its projection by more than the provider's tolerance
    or the drift default. The two default tolerances have names, in
    seconds.
    
    One behaviour changes, in the viewer's branch. Between two paused
    samples the viewer compared the move with the tolerance, where the
    owner compared exactly. With a paused room at 10 s and a provider
    tolerance of 2 s, a viewer who moved to 12 s and then to 13 s was
    outside the room's tolerance and had made no single move larger than
    it, so the look treated the position as drift and could pull it back.
    The person is now offered Sync at 13 s, as after one large move. A
    paused position is exact, as the forced alignment of a paused anchor
    already holds. The viewer's guard for a shared seek that an iframe
    reports one observation late is kept: it still requires the earlier
    sample to have been ready, or both to be paused.
    
    Left alone: an owner publishes a first ready sample that is displaced,
    where a viewer's first ready sample after buffering is allowed to
    rejoin. No assertion settled that for the owner; a test now holds what
    it does.
    
    Tests: paused scrubs that add up, the owner's first ready sample and a
    move measured at the previous rate, a forced running alignment near a
    future anchor, and a source lost while paused, ended, waiting and
    playing.
  • fix(input): a packet that is not text cannot unset the inbound budget
    The Browser's encrypted input bounds the text it has queued for
    decryption at 8,192 characters and closes when a peer exceeds it. The
    packet's `data` is what a peer put in a frame, and only its truthiness
    was checked before it was counted: an object has no length, the count
    became NaN, and from then on no packet could exceed the bound until the
    endpoint was replaced. receive now takes the value as unknown and drops
    anything but text before counting it, as Native's reader already
    requires three text fields.
    
    Found by reading the two implementations of the envelope side by side.
  • refactor(attachments): one way to retire a file sink
    A pending download's sink was taken out of the sink map in six places,
    each with its own subset of the steps: tell the delivery to cancel, tell
    the room's writer that receiving stopped, dispose the local writer and
    its temporary file, tell the listeners. stopSink is now the only remover
    and takes the reason: an error to end the readers with, "clear" for a
    cache clear that keeps the entry until its file is gone, or "released"
    when the file is already gone or was never made.
    
    What each caller knows stays with it. The room's writer is told only
    while the room is still this endpoint's to tell, which is read from the
    rooms the endpoint holds, so a lost room and a reset send no withdrawal
    and publish once, as before. A reader that aborts cancels the delivery
    at once, through the runtime it already holds, so the same file can be
    asked for again immediately.
    
    Two failures no longer skip the rest of the retirement:
    
    - When the last reader aborted and the delivery's cancel threw, the
      withdrawal to the writer and the disposal of the temporary file were
      skipped. Both now happen.
    - When a sink failed to start and the rollback's cancel threw, that
      error replaced the starting error and the half-made sink was never
      disposed. Readers now get the starting error and the writer and file
      are released.
    
    Left as it was: clearing a file that had already completed sends a
    second withdrawal.
    
    Tests: both throwing cancels, the immediate cancel and retry, the
    withdrawal on a cache clear, and no withdrawal while another reader
    remains or after the room is lost.
  • refactor(styles): remove rules for classes that nothing writes
    Twenty-seven rules, in five stylesheets, select a class that no script,
    template or page writes and that no built prefix can make: the 2.x
    viewer action cluster and its separator, the spacer, the slider, the
    name editor, the advanced door, the join door, the viewer entry brand,
    two watch source choices, the identity form, the invite actions, and
    the profile figure's rail size, whose class went with the change that
    gave each control one place.
    
    How it was established: every class a stylesheet selects was searched
    as a whole word across the scripts, the templates, the pages, the Rust
    sources and the documents. State classes built from a value, such as a
    notice's tone or a tooltip's side, were read at the place that builds
    them and stay.
  • refactor(transport): one rule for a flow that loses senders
    When the connection refuses some senders of an outgoing flow, the flow
    goes on with the others while a sender of its main kind is still live
    (video for a screen, audio otherwise), and fails as a whole otherwise.
    Three hand-written copies of this had drifted: a failed attach, a slot
    that could not be rebound, and a refused local offer. They now call
    rejectSenders, which fails an output only through failOutput.
    
    What changes at each site:
    
    - A refused offer that leaves no live picture marked the output failed
      and reported it, but left its other senders attached and their tracks
      in the flow's stream: a failed flow that kept sending. It now releases
      every sender and empties the stream, once, like the other two paths.
      The report is made as the flow fails, inside the pass over the flows,
      as resync already does; its listener only writes a message.
    - A failed attach and a failed rebind also removed the flow's other
      senders that were not live. A sender is not live when its track has
      ended, and also while its slot is still being rebound, which a
      refused offer finds queued behind it. Nothing refused those senders,
      so they stay with the owner that will finish or retire them, as the
      offer path already had it. A companion that was being attached is no
      longer dropped without a report because a different sender failed.
    - The main kind is read from the source in all three; the offer path
      read it from the carrier, which has the same kind.
    
    Each site keeps what only it knows: an attach refuses the senders it
    added in this attempt, a rebind its one slot, an offer the sender and
    track pairs it carried that differ from the confirmed ones.
    
    Two cases in a new transport test hold the offer path: no picture left
    releases the established sound and reports once, and a live picture
    keeps the senders the offer did not carry. The first fails before this
    change.
  • refactor(client): remove code and copy that nothing uses
    A module only its own test imported (media copy accounting), five
    exported definitions with no reader (a capture meter, a 2.x viewer
    limit, a 2.x voice command shape, a voice snapshot shape, a check of
    codec evidence with its helper), and 175 copy keys of the catalogue that
    no source file names and no built prefix can make.
    
    How it was established: the names and the keys were searched as whole
    words across the product, the previews, the README fixture, the tests
    and the scripts; the type check then proved the removal, since every
    use of a copy key is typed against the English catalogue. Two keys the
    catalogues use themselves for title labels were found that way and
    stay. Keys reached only through a loosely typed lookup (the launcher's
    failure reasons, the remote keyboard, tooltip labels) are built from a
    prefix and were left alone.
  • refactor(session): the record of a source says what it is, and has one way to gain a preference
    From the second reading of the previous commit. The map is named for what
    a record is, the page's intent toward a source, since it also holds the
    sources the page left. A change of state replaces the record's object and
    a change of a field writes in place; the comparisons made after an await
    rely on that, and the type now says so. A successor stops waiting as the
    waiting record it is, not by an id with an assertion. Choosing a candidate
    on the original page writes its preference through the one place that
    writes preferences, so a record the page left while that join was in
    flight stays left, as the room was last told and as it did before.
  • refactor(session): one record says how this page follows a source
    What this page intended toward each watch source or screen it follows was
    spread over three maps in ChannelSession: waitingWatchPages held a successor
    the room named and this page was to follow, watchRouting held the routes the
    page had taken by itself (its absence while a player existed stood for the
    person's choice), and declinedSources held the sources this page left until
    the room stopped naming them or a successor of them. The person's route was
    stored nowhere: a successor read it back from its predecessor's player.
    
    One map of one record per source replaces them. A record holds the room id,
    the person's preference (written only by a manual switch that succeeded, or
    by choosing a candidate on the original page), the routes the page took by
    itself while it chooses, and its state: waiting (with the source it replaces,
    the mode this page received that one by, and whether a browser can play it),
    followed, or left. A successor copies its predecessor's preference and starts
    with no routes. The confirmed subscription is still read from the room's
    snapshot and player readiness stays with Stage. The derived waitingWatchPages
    view is unchanged.
    
    Behaviour is unchanged: every test passes without changing an assertion.
  • fix(diagnostics): a default window error says what failed and where, not what it said
    The correction before this one reduced an unhandled error in the default
    history to a fixed category, because a message is free text and can name a
    media address. That left "Error" for every script failure, which tells a
    person who is handed the report nothing about what broke.
    
    The history now keeps two things that are not free text: the error's name
    when it is one the language or the platform defines (TypeError,
    NotAllowedError and the rest of the Web IDL table), and the path, line and
    column of the frames that lie in the page's own scripts. A name of code's
    own, the message, and frames of another origin are still left to the
    developer's probes.
  • fix(diagnostics): bound passive browser error details
    Keep configured ICE server identity and error codes in passive history while leaving free-form errors and local endpoint details to explicit developer probes. Omit raw device identifiers. Retain the established distinction between events and requested state samples.
  • refactor(watch): the offers a start tries no longer know the original page
    A start used to end its list of offers with the page itself, so a page
    nothing could be taken out of was started as original-page watching without
    the sharer choosing it. The caller stopped asking for that, by passing no
    page address, but the list kept the parameter and the branch, and a test
    still held the old order with the page last. Both are gone: the list is the
    media a start tries, and the original page is reached only by its own
    choice.
  • fix(watch): choose usable tracks and retain writer backpressure
    Use existing player duration and browser codec support for automatic indexed-track previews, and retain explicit webpage selection. Give source-window notices their intrinsic height. Carry writer delivery separately from ordinary Core effects so expiry does not bypass its queue.
  • refactor(core): centralize state changes and persistence outcomes
    Keep channel time explicit, room binding transitions owned by their records, and shared limits checked against Core. Persist the actual changes before delivery, preserving expiry and the original requester on failure. Include the verified receiving-route, cache-clear, tooltip and native appearance corrections from this integration phase.
  • fix(watch): the sharer is told what closing the source window does
    While a webpage watch plays in the App's separate window, the stage told
    its sharer only that the video uses that window and where to adjust sound.
    That window is the watch's source, and closing it ends the watch for the
    room. The sharer's line now says so, in place of the sound note and at the
    same length, so it fits where the earlier line fit at the narrowest width.
    A viewer's line is unchanged: closing their own window ends it for them
    alone.
  • fix(diagnostics): a sample is the report's state, and the history keeps what happened
    Corrections from review of the always-on history.
    
    A repeated measurement, and what a live owner says of itself for a report,
    is recorded through debugSample: it is the state of the report being made
    and does not enter the history, and outside a report it is kept only under
    the developer's probes. The raw statistics sample, the playback, channel
    and audio snapshots and the encoding pool's sample go that way. A track's
    state beside each statistics sample was recorded as an event twice per
    producer on every poll, with its settings; it is a sample now, and a
    track's own events stay events. Making a report no longer adds to the
    history it reads.
    
    A candidate error keeps the server that refused and the code; the local
    address and port are kept only for a developer.
    
    The App's history starts where its service starts, which the desktop
    binary and the Android runtime both enter; the Android entry never reached
    the installation in the desktop binary.
    
    A pair's facts are kept in the order their stages last happened, so a pair
    that disconnected and connected again ends on connected.
  • refactor(core): three reductions to the room record's transitions
    From review. Cancelling a reservation asks only whether the session holds
    it: binding clears the reservation, so a reserved room is never bound. The
    pause that drops the projection drops it first, since pausing would only
    empty what is discarded. Applying an output compares the old and new
    projections only when the old one was current, as it did before the
    transition was named: a stale one is replaced whatever it holds.
  • refactor(client): the forms' own name and password limits come from the limits module
    Two inputs and a title cut wrote the 64-unit name limit and two inputs wrote
    the 128-unit room password limit as literals. The password limit joins the
    checked module and the compiled Core emits it. The comment on the audio send
    bound says what it is: a budget for a frame of average size, not a promise
    about every encoded frame.
  • refactor(core): only the room address of a command is asked for
    The classification of a command by its owner had one runtime reader, the
    lookup of a room command's room. Its other classes were read by a test
    alone, and the set of commands whose change is undone stayed a separate
    list beside it. The classification is reduced to what is read: a helper
    that gives the room address of the commands a room's writer applies. The
    fixture test states each specimen's variant as before.
  • fix(core): an outcome says only what its turn did
    Corrections to the typed outcome of an authority turn, from review.
    
    A member's request for its room's writer is carried in the commit as the
    writer's connection and the event. It was the turn's last effect with a
    flag saying so, which the hub popped by position: with the writer's session
    offline nothing was delivered and the pop took another event or found none.
    
    A summary is reported as changed only when the output was applied; an
    output the binding had already passed is acknowledged and changes nothing.
    A removal forwarded to an online writer reports nothing durable: the header
    changes when the writer's answer arrives, and that turn saves it.
    
    A refusal carries no code of its own, since its scoped answer is already
    among the effects and nothing read the copy.
    
    The authority copies itself before fewer turns: not for a join by a
    personal credential, which is admitted as its stored user or refused and
    writes no user record, and not for a turn its session state will refuse.
  • fix(core): projection work between inputs keeps the channel's clock
    Taking the time of a turn as an argument removed the room host's stored
    clock, and with it the one thing that field was: the channel's clock as of
    the authority's last input. Route deadlines are set in that clock. A peer
    turn does not come through the authority, so finish_peer was given the
    writer's own time, and a writer whose clock runs ahead could expire a live
    preparation when a deleted message's attachment reconciled the projection.
    
    The room host keeps that clock again, named for what it is, written by
    dispatch alone. finish and finish_peer read it and take no time from their
    caller, so a caller can no longer supply a different one; the WASM binding,
    the stored room host and the tests follow. Channel's entries still take the
    turn's time as an argument.
  • refactor(core): the room record's transitions are named for what they do
    From the review of the previous commit. A registration's effect on a
    binding is invalidate_scope_and_read_policy, beside invalidate_scope. The
    pause that also drops the projection is named for that, so the two ways a
    room pauses can be told apart where they are called. apply_output returns
    whether it left the projection as it was and its caller combines that with
    its own condition. failed_pair retires routes through the binding's own
    method, which the test used a copy of. hosted_by is private. Behaviour is
    unchanged.
  • fix(watch): a confirmed embed starts without a second press
    Confirming a preview pauses it so that the room starts from a known
    point. A file was then started and an embed was not, so a person who had
    pressed start saw a paused YouTube or PeerTube player and pressed play
    again. An embed takes no command before its stage shows it and lets it
    play, which is why the start could not sit where the file's does.
    
    WatchPlayer.start plays as soon as the media may: at once when nothing
    restricts it, otherwise on the media's own report that playback became
    available, and never after the player closed. The committed embed is
    started with it once its presentation is mounted. A refusal by the
    browser is still shown by the player, as before.
  • refactor(core): a room record and its binding make their own transitions
    RemoteRoom and Binding now keep every field private to remote.rs. The
    writes that channel.rs, channel/discovery.rs and lib.rs made by hand move
    unchanged into named transitions on the records: reserving a room for its
    creator, a host binding or resuming, a registration asking for a covering
    scope and read policy, a session retiring, the creation policy pausing a
    room it no longer permits, applying a validated host output, settling
    replies, taking a deleted room's reply, and forgetting acknowledged pair
    failures. Readers ask named questions (reserved, reserved by, bound,
    hosted by, identified by, issued, read policy needed, routes covered,
    pair failed, route wake pending) or use borrowing accessors. Tests build
    the records through test-only constructors.
    
    Behaviour is unchanged: each moved block keeps its statements and their
    order, and no wire shape, error code or effect order changes.
  • refactor(client): the last two readers take limits from the limits module
    session.ts and ChannelShareControl.tsx were held while their source
    selection work was in flight, so protocol.ts and relay-capacity.ts kept
    re-exports of five limits for them. Both now import from
    src/shared/core-limits.ts as every other caller does, the re-exports are
    gone, and relay-capacity.ts, which held nothing else, is deleted.
  • docs(core): say what the route and the undoable set promise
    Notes from reading the four framework commits. Command::route states that
    its match has no catch-all, which is what makes it the one classification.
    Command::undoable states its contract with Authority::turn: the authority
    keeps its earlier state only for these commands, so a branch that reports a
    changed user or header record must be listed. The upper end of the audio
    send range has its reason again.
  • fix(diagnostics): no kind of event can push out another, and raw samples stay a probe
    With history always recorded, every statistics sample its owner takes went
    into one shared ring: a raw WebRTC sample per connection per poll and an
    encoding pool sample twice a second. At that rate the 8 MiB ring held about
    two minutes, so the rare events that explain a failure, such as how a
    connection's candidate pairs ended, were gone before anyone could export
    them, and each sample paid for sanitizing a whole statistics report.
    
    The history now keeps each kind of event apart: a kind keeps its newest 512,
    and over the 8 MiB budget the kind that holds the most gives up its oldest.
    The total count bound is gone, since the two bounds that remain already limit
    it. A repeated measurement is recorded where it belongs: under the
    developer's flag, or while a report is being made, where it is the report's
    state. From each statistics sample the history keeps the connection's path
    when it changes: how its candidate pairs stand and which one carries it.
    The encoding pool's periodic sample is a developer's probe again.
  • refactor(core): each Core limit has one writer and TypeScript reads one checked copy
    The Core wrote several limits as bare literals, some of them twice: the voice
    bitrate default and send range, the relay capacity default, member, room and
    title name lengths, short keys, IDs, attachment names, message and reply text,
    watch URLs and rate, signal SDP and candidates, and room passwords. Each is now
    one named const in the Core module that validates it, and the production Rust
    copies, Native's screen source title among them, refer to it. Boundary tests
    keep their own literals.
    
    TypeScript held its copies in protocol.ts, shared/protocol.ts,
    relay-capacity.ts, room-interactions.ts and remote-control/protocol.ts. They
    move to src/shared/core-limits.ts and the callers import from there.
    channel_wire_limits now emits every limit under its TypeScript name, so the
    parity test compares the whole module with the compiled Core. protocol.ts and
    relay-capacity.ts re-export only the names that session.ts and
    ChannelShareControl.tsx still import, because those files are held elsewhere.
    No value changes.
  • feat(diagnostics): history is always recorded, and only active probes wait for a developer
    A person had to turn recording on before a problem for its report to say
    what led up to it, and nobody does that before a problem. Recording is
    now passive and always on: the page and the App keep a bounded history in
    memory (8,192 events or 8 MiB), and a report is exported on demand. There
    is no recording switch for a person any more.
    
    The page's diagnostic control is one button that downloads the report, and
    the App launcher's is one button that downloads the App report. The
    launcher state no longer carries a debug field, the route that enabled App
    recording is gone, and the App no longer adds a debug flag to the pages it
    opens. The App installs its recorder at its start, before anything can
    log; the Server binary does not, so it is unchanged. Every guard that kept
    an event from being recorded is removed, and audio capture and capture
    frame counters always count.
    
    What stays off by default is the work that costs something of its own:
    the page's per-frame gap loop and console echo, which `?debug=1` starts,
    and the App's window-loop lateness probe and shutdown progress lines,
    which `PIIK_DIAGNOSTIC_PROBES=1` starts. Reports say whether probes ran
    instead of whether recording was on. The copy describes the report in all
    five languages, and keys and the visual kind that lost their last user are
    removed.
    
    Tests now assert that history is recorded with nothing switched on, that
    the probes run only with the developer's flag, and keep every assertion on
    bounds, secret filtering and report contents.