fix(riverpod): a listener that reads the value is not a render #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/riverpod-listen-is-not-a-render"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
riverpod-async-gap counted any site that read an AsyncValue as a UI read, including
ref.listen. A listener mirrors the value into a side effect and draws nothing, so it cannot leave a blank or stale screen.Found by dogfooding on word_alive (PR trvon/word-alive#41).
internalUserProvideris read only by aref.listeninmain.dartthat sets an analytics user property, and it was reported as an info-level gap.Solution
A gap now needs a
ref.watchthat reads the value. Listeners still count as places that handle error or loading, as before.Rule changes
ref.listen.listenOnlyProvidernegative case instuck_loading/lib/riverpod_gaps.dart; the existingunhandledProviderpositive case still fires.Release Note
riverpod-async-gapno longer reports providers that are only listened to, not rendered.Breaking Changes
Tests
scripts/lint.sh format|analyze|test: clean, 135 passed.Documentation
AI usage