KRTirtho / fl-query

Asynchronous data fetching & data invalidation libraries for Flutter
https://fl-query.krtirtho.dev/
Apache License 2.0
60 stars 11 forks source link

Fix: prevent refresh when query is disabled #38 #53

Open ganeshh123 opened 8 months ago

ganeshh123 commented 8 months ago

Would appreciate it if you could check over it and suggest changes @PetrKubes97

PetrKubes97 commented 8 months ago

Thanks for the PR. Sorry, I think I've led you in the wrong direction.

Looking at the code now, I'm thinking the following scenario:

You've also written:

Setting refreshOnMount explicitly doesn't seem to work on the disabled query either, it gets overriden by the QueryClientProvider it seems.

If useQuery(refreshConfig) gets overriden, it's definitely a bug.

ganeshh123 commented 8 months ago

Yeah, the query's refresh config should take precedence over the query client's right?

So how should we go about enforcing that?

PetrKubes97 commented 7 months ago

I've taken a quick look at the code and I don't see any obvious mistakes.

A good first step would be to create an sample that reproduces the issue, for example in the examples folder.