File: lib/screens/video_player_screen.dart
Lines: ~289 & 318
Description:
The dispose() method synchronously calls _api.updateProgress(...) without awaiting, causing an unawaited network request that outlives the context. Concurrently, if the user explicitly triggers a back navigation via _navigateBack(), it also calls await _api.updateProgress(...).
This leads to redundant, identical API requests to the backend when exiting a video, and relies on an anti-pattern (unawaited Futures during widget disposal) that can silently drop progress saves if the network client shuts down.
Impact: Redundant network load and unreliable watch progress saving.
Suggested Fix:
Consolidate the progress saving logic. Make sure it's only called once when dismissing the player, using a safe background task or route observer.
File:
lib/screens/video_player_screen.dartLines: ~289 & 318
Description:
The
dispose()method synchronously calls_api.updateProgress(...)without awaiting, causing an unawaited network request that outlives the context. Concurrently, if the user explicitly triggers a back navigation via_navigateBack(), it also callsawait _api.updateProgress(...).This leads to redundant, identical API requests to the backend when exiting a video, and relies on an anti-pattern (unawaited Futures during widget disposal) that can silently drop progress saves if the network client shuts down.
Impact: Redundant network load and unreliable watch progress saving.
Suggested Fix:
Consolidate the progress saving logic. Make sure it's only called once when dismissing the player, using a safe background task or route observer.