@moq/net: make direct and relayed reads report the same gaps as Rust

Đang mở
#10,299 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, rust
Lĩnh vực
backend, networking

Hướng nghiên cứu

Start with js/net/src/publisher_accounting.test.ts and compare its cases with rs/moq-net/tests/integration/publisher_accounting.rs to see the expected groups and gaps. Trace the JS publisher and relay handling for the four divergences listed in the issue, then use the Rust time-start behavior in rs/moq-net/src/model/track.rs as context. Done when the known list is empty and each JS case reads what its Rust twin reads.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Goal

@moq/net readers should learn the same groups and gaps whether they read a publisher directly, through a cold relay copy, or through a warmed one. The Rust moq-net harness already proves this for Rust. Done means the known list in js/net/src/publisher_accounting.test.ts is empty, and each case reads what its Rust twin in rs/moq-net/tests/integration/publisher_accounting.rs reads.

Non-goals: Rust changes, except where a JS fix shows that Rust diverges too.

Context

Split from moq-net-publisher-accounting in https://github.com/moq-dev/moq/pull/10178. The lite-07 wire-invariant proofs are Rust-only, so these JS gaps block nothing before the 0.22.0 cut.

Divergences the JS harness pins today:

  • Origin-front reads omit gaps. A read through the origin's own front (origin.consume().request) omits the gap a fill reported as not found over keys the publisher never produced. This covers the keys below its first group once the handle closes, and every key a handler answered (cases dropping, refusing, and unanswering handler). producer.subscribe and relayed reads do report these gaps.
  • No record of evicted groups. The JS publisher keeps no record of the groups its cache let go (Rust keeps TrackState::departed). So neither a direct read nor a cold relay copy names evicted groups (cases evicted and time in evicted).
  • Relay copies wait on evicted groups. A relay copy, warm or cold, keeps waiting on evicted groups after its readers parked, and names them not found only after the finish (case evicted).
  • Warmed copies ask fills from 0. A warmed copy asks a fill below its live group from 0, and the publisher drops it whole (case time in evicted, which reads gap 0..4000 not found).

Plan

Once JS records departures, mirror the Rust time-start fix. A lite-07 publisher should answer a time start that reaches back past every group it holds at the first key it names from that time, not at the next group held. In Rust this is SourceStart::Named in rs/moq-net/src/model/track.rs, used by both TrackRun::starts and TrackRun::report_started.

(Written by Claude Opus 5.5)

Ngôn ngữ chính
Rust
Star
1.6k
Fork
251
Merge trung bình
10 giờ 10 phút
Pull request đã merge (30 ngày)
832

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của moq-dev/moq

Tất cả issue của moq-dev/moq

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.