You are stuck on a thorny issue. Take your time. Be comprehensive—thoroughness beats speed here.
- Create hypotheses - List all possible causes for what's wrong. Don't jump to conclusions.
- Read all related code - Read ALL code that could be related. Take your time. Don't skim.
- Add strategic logging - Add console.log statements to verify your assumptions about what's actually happening.
- Ultrathink - Think step by step through the problem. Consider edge cases.