Skip to content

release: v1.0.0-alpha.5 - #3

Merged
RealHeart merged 4 commits into
mainfrom
dev
Aug 14, 2026
Merged

release: v1.0.0-alpha.5#3
RealHeart merged 4 commits into
mainfrom
dev

Conversation

@RealHeart

Copy link
Copy Markdown
Contributor

变更

  • 修复 HTTP 音频正文中断或停滞后直接结束播放的问题
  • 支持从已下载偏移通过 Range 自动续传,并校验服务端响应范围
  • 兼容忽略 Range 的源站,并限制重连次数避免无限重试
  • 更新版本至 1.0.0-alpha.5

验证

  • cargo test --all-targets
  • HTTP 断流测试连续运行 3 轮
  • cargo clippy --lib --bins --test cli --test truncated_http --test online_playback -- -D warnings
  • 在线 MP3 下载至 EOF 测试
  • cargo build --release
  • Java JNI 烟雾测试
  • rustfmt --edition 2024 --check rust/src/stream.rs
  • git diff --check

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ef4004566

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust/src/stream.rs
Comment on lines +599 to +601
if *reconnect_attempts < MAX_RECONNECT_ATTEMPTS {
*reconnect_attempts += 1;
return Some((resume_offset, true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the retry budget after successful progress

The retry counter only increases and is never reset after a resumed response successfully transfers data. Consequently, a long track that experiences three recoverable disconnects at widely separated offsets will fail immediately on its fourth disconnect, even though every prior reconnection succeeded; the limit should apply to consecutive failures, with the counter reset once the resumed request makes progress.

Useful? React with 👍 / 👎.

Comment thread rust/src/stream.rs
Comment on lines +532 to +534
if state.end_offset != start_offset
|| matches!((state.total_size, total_size), (Some(old), Some(new)) if old != new)
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind resumed ranges to the original representation

When the URL's resource changes between the interrupted response and the retry, this check accepts the resumed body solely because its offset and optional total size match. A replacement object with the same length is therefore appended to the buffered prefix of the old object, silently producing mixed audio; retain a response validator such as a strong ETag and validate it or use If-Range before preserving the buffer.

Useful? React with 👍 / 👎.

Comment thread rust/src/stream.rs
Comment on lines +641 to +647
fn parse_content_range_start(response: &reqwest::Response) -> Option<u64> {
let value = response.headers().get(CONTENT_RANGE)?.to_str().ok()?;
let (unit, range) = value.trim().split_once(' ')?;
if !unit.eq_ignore_ascii_case("bytes") {
return None;
}
range.split_once('-')?.0.parse().ok()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify that resumed partial responses reach their advertised end

The new range validation retains only the response's starting offset. If a resumed 206 uses chunked transfer encoding and terminates cleanly before the end declared by Content-Range, response.chunk() returns EOF rather than a transport error, so the loop marks the shorter wire_offset complete and playback silently ends early instead of retrying or reporting truncation; parse the range end and compare it with the final offset.

Useful? React with 👍 / 👎.

@RealHeart
RealHeart merged commit fb2ecaf into main Aug 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant