jaredLunde / jaredLunde/react-hook
React-cache sometimes falls into infinite loop
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
An application that uses cache sometimes freezes,
**To Reproduce**
Steps to reproduce the behavior:
1. Create a component that uses a cached value with the given key
2. Create another component that uses a cached value with the same key
3. Remove the second component from the components tree
4. Write a new value for the watched key
5. Application freezes
**Expected behavior**
The remaining component should be refreshed,
**Screenshots**
None
**Desktop (please complete the following information):**
- OS: found on Windows and Mac
- Browser: found on Edge, Chrome, Safari and Firefox
- Version: pretty current
**Smartphone (please complete the following information):**
Not tested on mobile
**Additional context**
PR is already prepared
Contributor guide
Research direction
No files or tests are named. Start by reproducing the freeze with two components sharing a cached key, then inspect the cache implementation and its handling when one component is removed. Done means updating the watched key refreshes the remaining component without freezing the application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100