Closed r-token closed 7 months ago
Hi! This should not be possible — there isn't much caching in Blackbird, and the caching that's there should automatically flush its contents after any relevant write.
Is there any way you could show the relevant parts of the code here, or even better, a sample project that reproduces the problem, so we can determine if it's a bug?
My mistake! After some more digging throughout the week I found the issue. It is on our end.
A specific API request we were making was the source of the stale data. We make that GET request shortly after updating the property in Blackbird, and then upsert the stale API response data back into Blackbird - thus overwriting the local change we had just made. I mistook that for a caching problem.
Sorry for the false alarm. Hope you didn't spend much time looking into this. Love the library! We've found it much more flexible than SwiftData. Thank you for making it.
Happy to "help" (by doing nothing)! Glad you found the problem, and thanks for the kind words.
Hi there.
We have a specific query that retrieves data from multiple tables. This query is run immediately after updating a property in one of those tables.
However, we've noticed that, occasionally, the query returns stale data, returning what appears to be a cached/previous value instead of the recently-updated value.
Is there a way to disable caching for this specific query? If not, do you have any suggestions for how we might work around this?