`withCache` can send stale data
Open
- Dominant language
- TypeScript
- Stars
- 11
- Forks
- 8
- Avg merge
- 14h 29m
- Merged PRs (30d)
- 27
Description
1. Create an underlying observable
2. Wrap using `withCache`
3. Attach an observer to the cached observable
4. Send a value (A) through the underlying observable
5. Unobserve from the cached observable
6. Send another value (B) through the underlying
7. Attach a new observer to the cached observable
8. New observer receives (A) immediately, despite A being a stale value.
This issue is made worse for observers like `toPromise` which will unobserved after receiving their first value, meaning they only ever receive a stale value.
Contributor guide
Assessment
This issue has not been assessed yet.