Skip to content

fix: harden persistence, playback, and verification gates - #773

Merged
cwuom merged 5 commits into
masterfrom
fix/maintainability-hardening
Nov 30, 2026
Merged

cwuom merged 5 commits into
masterfrom
fix/maintainability-hardening

Conversation

@cwuom

@cwuom cwuom commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

描述 / Description

Concurrent backup restores could overwrite local edits, stale creator requests could update refreshed pages, and partial HTTP responses could end playback early. This change fixes those paths and makes test discovery, Native checks, and release eligibility fail closed.

  • Merge restored playlists and history under repository locks, check restore persistence, and preserve history identity compatibility. Preserve IMPORT_BACKUP activity entries and undo semantics when restoring playlists.
  • Coordinate fallback JSON writes with legacy cleanup inside the existing Room transaction; acknowledge persistence only after the primary-store marker commits. Preserve unreadable legacy data, recover from cancelled writes, and reject stale snapshots after clearing statistics.
  • Apply request generations to Bilibili, NetEase, and YouTube creator loading and playback queues. Prevent duplicate pagination, use raw NetEase row counts for offsets, and recheck current YouTube catalog settings before publishing results.
  • Bound external artwork reads, stage immutable content-URI snapshots, and protect DLNA preparation with leases. Handle unknown-length HTTP 206 segments correctly and cancel only the prefetch worker and its HTTP calls while retaining cache-writer coordination.
  • Register sync instrumentation, independently discover and compare the complete test inventory, batch discovery into one Gradle invocation, and add strict API 34 phone/API 35 tablet compatibility lanes. Reuse USB/DSP host gates and require the latest successful Android CI attempt for the exact release SHA before signing and publication.
  • Join creator ViewModel jobs before resetting the unit-test Main dispatcher so cancelled IO cannot leak into the next test. Cover blocked IO cleanup with a regression that also fails when the join is removed.
  • Update maintained module and contribution guides. Remove 52 tracked process/research files; keep maintained implementation/API guides and product screenshots.

类型 / Type

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 文档更新 / Documentation update
  • 其他(请描述)/ Other (please describe): CI verification and release gate hardening.

修复或解决的问题 / Issues fixed or closed by this PR

No linked issue is auto-closed.

清单 / Checklist

  • 我已阅读并遵循贡献指南 / I have read and followed the contribution guidelines
  • 我已在本地测试这些更改 / I have tested these changes locally
  • 我已运行必要的构建、测试或静态检查 / I have run the required build, tests, or static checks
  • 我已更新相关文档或注释(如适用)/ I have updated relevant documentation or comments (if applicable)
  • 本次更改没有破坏原有行为 / This change does not break existing behavior
  • 本次更改向下兼容(如适用)/ This change is backward compatible (if applicable)
  • 没有提交密钥、Token 或其他敏感信息 / No secrets, tokens, or other sensitive information are committed
  • UI 变更已附截图或录屏(如适用)/ UI changes include screenshots or recordings (if applicable)

AI 协助 / AI assistance

  • 未使用 AI Agent 协助开发 / No AI agent was used for this change
  • 使用了 AI Agent 协助开发 / An AI agent assisted with this change

使用的 AI 模型 / AI model(s) used:

OpenAI GPT-6 (Codex; the exact serving version is not exposed in this session).

其他信息 / Additional information

Earlier local validation (before the latest master integration):

  • verifyModularization, Debug APK, app test APK, and local test APK builds succeeded in 29m 43s.
  • App and 14 owned JVM-library reports total 16,939 tests, 0 failures, 0 errors, and 7 existing skips. Unchanged modules may reuse Gradle results. The 121 passing targeted regressions are included in these totals.
  • Aggregate CRAP reported 62,172 methods; all 16,071 scoped methods meet the raw score limit of 9. Module boundaries, domain dependencies, lint, build-logic checks, and 166 quality-tool tests passed.
  • Workflow Python tests: 117 passed. Node automation tests: 31 passed. actionlint 1.7.12, shell syntax, and diff checks passed.
  • The API 35 ARM64 PlayStore tablet executed the exact startup case with no skip. Sync instrumentation executed 7 passing cases on an emulator. Inventory discovery found 1,636 app and 181 library cases; discovery counts are not execution counts.
  • Earlier macOS Host validation passed all three USB profiles with 37 CTests each, plus normal and ASan/UBSan DSP profiles with 1 CTest each. These Host results precede the final Kotlin playback/persistence fixes; the Native implementation was unchanged afterward. The final Debug APK contains nonempty Native libraries for all four ABIs.
  • Documentation cleanup verified 93 relative links and found no remaining references to removed files.

Latest local validation:

  • The creator-related suites passed 41 tests after fixing Main-dispatcher teardown. The blocked-IO cleanup regression failed before the fix and when the job join was deliberately removed, then passed with the join restored.
  • After integrating master 2cd8dd840ad795dab9b421d8a435badf8d8c7bff, targeted app suites passed 149 tests and local-library suites passed 51 tests, with zero failures, errors, or skips. These cover creator loading/playback, playlist sorting and activity history, backup restore/undo, playback-bar text, and cover scoring.

Latest CI validation for 2665dfc07c58441ffa8c8c834a3f00e4e03fb440:

  • Android CI, Native CI, and Automation checks all succeeded. Across these workflows, 21 checks passed; the two publication jobs were skipped for the pull-request event.
  • JVM reports contain 17,349 tests across the app, 14 owned libraries, and build logic: zero failures, zero errors, and nine conditional skips. Both creator lifecycle suites passed all 11 tests.
  • Aggregate CRAP reported 62,663 methods; all 16,071 scoped methods meet the raw score limit of 9. The Gradle test, lint, and verification job succeeded.
  • The complete instrumentation inventory matched the four app shards, three dedicated hosts, and five library modules: 1,772 tests passed and 45 were conditionally skipped. The independent API 34 WAL and API 35 tablet regressions both passed without skips.
  • The Release build, all six Native jobs, complete test-inventory validation, compatibility validation, and final APK identity gate passed.

Limits and compatibility:

  • API 34 WAL instrumentation was not run locally because its system image is unavailable; its remote CI lane passed. Manual/Nightly signed release publication, physical-device acceptance, and production-provider acceptance remain unverified.
  • A stackless SDK 35 Main Thread exception prefix remains in the successful current-head Gradle log without a corresponding JUnit failure. Its exact test and cause remain unknown.
  • Existing Native action deprecation annotations remain for actions/checkout@v4, actions/setup-java@v4, and actions/upload-artifact@v4.
  • Startup, frame-time, power, and network-latency changes were not benchmarked before and after the fixes.
  • Existing public constructors and storage formats are retained. Broad behavior/compatibility checkboxes remain unchecked because the device and provider matrix is not exhaustive. UI changes affect existing loading/error state ownership without a layout redesign.

本 PR 加固持久化、播放与发布验证:

  • 歌单与播放历史恢复在仓库锁内合并,持久化成功后才更新界面。
  • 流量统计写入 Room 失败时禁用 Room 并回退 JSON;取消时标记需完整写入,不回退。无法读取的旧数据予以保留。
  • 艺人页与 YouTube 创建者页忽略过期请求结果,并阻止重复分页。
  • DLNA 封面读取上限为 8 MiB;预取取消仅作用于预取 HTTP 调用。
  • 发布前要求最新 Android CI 成功;新增兼容性测试通道。
    新增相关单元测试。远程 CI 尚未验证。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T11:30:50.179928Z 2665dfc New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

此变更更新 Android instrumentation、兼容性测试、Native host 测试和发布门禁。艺人页面请求增加过期结果校验与分页保护。备份恢复和流量统计持久化调整合并、取消及回退处理。DLNA 暂存、HTTP 分段读取和媒体预取也有更新,并新增对应测试。此外,变更删除一组研究资料,并调整 USB 进程快照采样方式。

Merge Risk: Minimal · up to 17f31 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“fix: harden persistence, playback, and verification gates”概括了 PR 的主要变更:持久化(备份恢复、流量统计、历史记录)、播放(DLNA 预取、HTTP 206 分段、创建者页面请求代际校验)以及验证门禁(兼容性测试、instrumentation 清单、发布门禁)。标题简短,未使用模糊词语,与变更集高度相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0dde5f9 and 17f318a.

Files selected for processing: 2

  • app/src/test/java/moe/ouom/neriplayer/ui/viewmodel/artist/YouTubeMusicCreatorDetailPlaybackTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/viewmodel/artist/YouTubeMusicCreatorDetailStartTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@cwuom
cwuom merged commit d811add into master Nov 30, 2026
23 checks passed
@cwuom
cwuom deleted the fix/maintainability-hardening branch November 30, 2026 12:24
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