mirror of
https://github.com/Silent1566/webhtv.git
synced 2026-11-14 02:00:15 +00:00
Verification: Focused tests InterfaceFailoverPolicyTest/StateTest/OrderStoreTest/BackupPreferenceFilterTest passed; Mobile and Leanback Arm64 javac passed; git diff --check passed Task-Guard: failover-default-auto-review-20260914
5.9 KiB
5.9 KiB
interface-failover-v1
Recovery anchor
- Objective: implement VOD configuration failover from
docs/interface-failover-design.md. - Acceptance: off/auto/confirm modes, ordered URL candidates, bounded single-round retries, one final callback/event, manual cancel and selection, drag reorder, backup keys, focused verification.
- Lane/scope: standard;
app/**, this document only. Initial dirty paths: none. - Base: detached
449b94a118b5d1f5e55745dba193da735febe711. - Completed: policy/store/settings/resources; centralized
VodConfigfailover; candidate list and cancel; mobile/TV history drag reorder; backup whitelist. - Current files:
VodConfig,BaseConfig,InterfaceOrderStore, both config adapters and history dialogs,Backup, settings/resources, tests. - Verification: prior compile exposed missing JSON read and
Rimport; both fixed. Focused policy/order/state/backup tests and Mobile/Leanback Arm64 Java compilation now pass. - Risks: no APK/device validation; current machine has about 2.5 GiB available memory but APK packaging is intentionally not attempted.
- Next action: none for the source implementation; the current task is committed and tagged. Device/APK validation remains an explicitly separate follow-up.
Decision
Use the narrow project-adapted design: default AUTO, URL order in preferences, maximum three candidates, automatic mode retries remaining candidates, confirm mode shows the remaining list once and ends the round after a selected candidate fails. Manual selection starts a fresh round. Intermediate failures do not emit VOD events; only terminal success/failure does.
Verification log
git diff --check: passed.InterfaceFailoverPolicyTestandInterfaceOrderStoreTest: passed via:app:testMobileArm64_v8aDebugUnitTest.:app:compileMobileArm64_v8aDebugJavaWithJavac: passed.:app:compileLeanbackArm64_v8aDebugJavaWithJavac: passed.- APK packaging: not run; available memory must be checked first and must be at least 1.5 GiB.
- Follow-up: history selection now uses the caller's existing VOD callback chain; the original failed interface plus at most two fallback candidates make three total attempts, and fallback errors are not double-wrapped.
Follow-up verification
git diff --check: passed.:app:compileMobileArm64_v8aDebugJavaWithJavac: passed.:app:compileLeanbackArm64_v8aDebugJavaWithJavac: passed.- Scope review: history selection delegates to
ConfigListener; VOD history keeps the current interface visible; automatic failover uses at most two fallback candidates; confirm mode ends after the selected candidate fails. - Runtime safety: switching the mode to
Offcancels queued failover work and prevents a pending round from starting another candidate request. - Runtime safety: cancellation during an active candidate request leaves the terminal event to that request's
finallyblock, avoiding duplicate refresh events. - Runtime safety: cancellation now invalidates and aborts an active BaseConfig task, so a late candidate success cannot mutate the active VOD state or emit a refresh event.
- Failure classification: a successfully parsed VOD payload with an empty
siteslist is treated as a configuration-load failure and enters the same failover path. - Invalidation: ordinary direct
VodConfig.load()calls now invalidate the superseded task without delivering a stale error, then start a fresh round; only the internal candidate loader preserves the current round. - Policy/order evidence: invalid modes fall back to the default
AUTOmode; the fallback limit reserves the origin attempt, and URL sorting is tested for saved-order precedence, new-URL append, duplicate removal, and ignored deleted URLs. - State evidence:
InterfaceFailoverStateTestdrives automatic unique candidate progression with the three-attempt cap, confirm-mode single selection, and cancellation blocking all later attempts;VodConfignow uses this state for candidate selection and rejects stale attempt callbacks.
Default AUTO review
- Reviewed commits:
c89b166e6e39c01fe1ea8446346316983adac726andca9febe024002e55945a55caa6f66023da405699. - Compared with the previously reviewed implementation commit
3562be1ecf0a32ce4b7b0222ffbbff4d06254fe7, the only behavior change isInterfaceFailoverPolicy.DEFAULT_MODEfromOFFtoAUTO; invalid stored or supplied modes now clamp toAUTO, and the policy tests assert that behavior. git diff --check: passed.:app:testMobileArm64_v8aDebugUnitTestfocused onInterfaceFailoverPolicyTest,InterfaceFailoverStateTest,InterfaceOrderStoreTest, andBackupPreferenceFilterTest: passed.:app:compileMobileArm64_v8aDebugJavaWithJavacand:app:compileLeanbackArm64_v8aDebugJavaWithJavac: passed.
Runtime-off verification
git diff --check: passed.:app:compileMobileArm64_v8aDebugJavaWithJavac: passed.:app:compileLeanbackArm64_v8aDebugJavaWithJavac: passed.- Source review: switching to
Offclears the active round, closes the pending confirmation dialog, delivers the original failure once, and prevents any queued next candidate from starting. - Sync evidence: the one-key sync settings checkbox is selected by default, and
BackupPreferenceFilterTestconfirms bothinterface_failover_modeandinterface_order_vodare included when settings are selected; duplicate legacy whitelist entries were removed without dropping the current settings keys. - Final source closure: commit
3562be1ecf0a32ce4b7b0222ffbbff4d06254fe7, recovery tagrecovery/interface-failover-v1-state-tests/20260913203608-3562be1ecf0a; worktree was clean after closure. No APK was built because APK packaging requires a fresh check for at least 1.5 GiB available memory, and no device interaction was requested or run.
Closure
The source implementation is complete and committed. Focused state, policy, order, and backup tests plus Mobile/Leanback Arm64 Java compilation pass. Device interaction and APK artifact validation remain outside this source-focused change; no APK was produced.