rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
5.97k stars 923 forks source link

Multiple invalidation of Providers #3571

Open MichaelLucca opened 1 month ago

MichaelLucca commented 1 month ago

Describe the bug The bug concerns the invalidation of multiple providers, which leads to incorrect state management and unexpected behaviors in the application. When attempting to invalidate multiple providers, only the last one is invalidated correctly.

To Reproduce

  1. Create a screen with two Widgets, each depending on a different provider.
  2. Call the invalidate method for both providers.
  3. Observe that only the last provider, affiliatedRestaurantsProvider, is triggered for invalidation.

Here is an example: image

Expected behavior All the providers must be invalidated and rebuilded.

myxzlpltk commented 1 month ago

Can you show us how you defined your riverpod?

rrousselGit commented 1 week ago

A complete example is necessary to reproduce this.
As it is, I am capable of invalidating multiple providers at once. So there's likely something more to what you're saying here.