Skip to content

Refactor/pr3 history pageurl#2274

Closed
liangyuR wants to merge 19 commits into
Predidit:mainfrom
liangyuR:refactor/pr3-history-pageurl
Closed

Refactor/pr3 history pageurl#2274
liangyuR wants to merge 19 commits into
Predidit:mainfrom
liangyuR:refactor/pr3-history-pageurl

Conversation

@liangyuR

Copy link
Copy Markdown
Contributor

No description provided.

liangyuR and others added 19 commits June 23, 2026 21:37
Co-authored-by: 文质彬彬的大锤 <liangyuR@users.noreply.github.com>
Document the five-PR rollout for pageUrl-based episode identity, including PR2 EpisodeRef scope and acceptance criteria.

Co-authored-by: Cursor <cursoragent@cursor.com>
- 引入 EpisodeRef 承载播放集数页地址和排序号

- 播放切集与媒体队列复用统一集数解析结果

- 更新 EpisodeRef 单元测试
- 在 PlaybackInitParams 中引入 sortNumber,用作剧集排序参考。
- 更新 EpisodeRef,新增 sortNumber,并补充在线与离线上下文中的详细解析说明。
- 合并 codex/refactor-episode-ref-upstream,为 PR3 历史 pageUrl 主键改造准备基础。
@liangyuR liangyuR closed this Jun 26, 2026
// 自动播放下一集
final playingSelection = videoPageController.playbackEpisode;
final playingRoadData =
videoPageController.roadList[playingSelection.road];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: roadList[playingSelection.road] is now indexed unconditionally on every 1s timer tick.

Previously this access lived inside the playerController.playback.completed && ... condition, so the short-circuit meant it was only evaluated on completion ticks. Hoisting it out means it runs every tick, before the !videoPageController.loading guard. roadList is cleared during source/reload (roadList.clear() at video_controller.dart:243 and :767), and playbackEpisode falls back to selectedEpisode, so an empty or shorter roadList here throws a RangeError inside the periodic timer. The parallel _syncAudioServiceState guards this exact case (roadList.isEmpty || currentRoad < 0 || currentRoad >= roadList.length); consider guarding bounds before indexing here too.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

final Progress progress;
}

class _HistoryEpisodeMatcher {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: _HistoryEpisodeMatch / _HistoryEpisodeMatcher are duplicated verbatim here and in lib/modules/history/history_sync.dart. The page-url matching and bucket-allocation logic must stay byte-for-byte identical between the sync merger and the repository for progress buckets to line up; if one copy diverges later, local writes and synced merges will silently disagree. Consider extracting a single shared helper.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
lib/pages/player/player_item.dart 1040 roadList[playingSelection.road] indexed unconditionally every timer tick (was short-circuited by completed); RangeError risk when roadList is cleared during reload.

SUGGESTION

File Line Issue
lib/repositories/history_repository.dart 514 _HistoryEpisodeMatcher/_HistoryEpisodeMatch duplicated verbatim with history_sync.dart; risk of silent divergence between repository and sync merger.
Files Reviewed (12 files)
  • lib/modules/history/history_module.dart - 0 issues
  • lib/modules/history/history_module.g.dart - 0 issues (generated)
  • lib/modules/history/history_sync.dart - 0 issues
  • lib/pages/history/history_controller.dart - 0 issues
  • lib/pages/player/controller/player_models.dart - 0 issues
  • lib/pages/player/player_item.dart - 1 issue
  • lib/pages/video/video_controller.dart - 0 issues
  • lib/pages/video/video_page.dart - 0 issues
  • lib/repositories/history_repository.dart - 1 issue
  • lib/services/sync/history_sync_service.dart - 0 issues
  • test/episode_ref_test.dart - 0 issues
  • test/history_repository_test.dart, test/history_sync_test.dart - 0 issues

Note: PR is in CLOSED state; review provided for reference.

Fix these issues in Kilo Cloud


Reviewed by claude-4.8-opus-20260528 · Input: 4.2K · Output: 16.4K · Cached: 1.1M

@Predidit

Copy link
Copy Markdown
Owner

Hi, 这个PR出了什么问题吗

@liangyuR

Copy link
Copy Markdown
Contributor Author

Hi, 这个PR出了什么问题吗

这个PR是我合并自己的fork的,误触放在这里了

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.

3 participants