Cache Issue Debug (TypeScript)
Diagnose cache invalidation and stale data issues in TypeScript code.
Parameters
| Name | Label | Required | Default |
|---|---|---|---|
| code | Code with Bug | Yes | - |
| error | Error Message / Symptom | Yes | - |
| steps | Reproduction Steps | No | - |
Prompt Template
Example
Tips
- ✦Provide the full stack trace — truncated traces hide the actual origin.
- ✦Include reproduction steps so the debugger can verify the fix resolves the issue.
- ✦Ask for a preventive test, not just a fix — tests stop regressions.
Why
According to the Stack Overflow 2024 survey, 76% of developers use or plan to use AI tools, and AI-assisted debugging reduces mean-time-to-resolution by 40% for cache invalidation and stale data issues. Systematic diagnosis of cache invalidation and stale data issues reduces mean-time-to-resolution and prevents fix-by-coincidence. Cursor reports $65M ARR from AI debugging features, confirming industry adoption of structured root-cause analysis.
When
When encountering cache invalidation and stale data issues that is not immediately obvious from the error message alone. Do not use this prompt for errors with self-explanatory messages or one-line typo fixes.
Common Problems
- ⚠Error: TypeError: Cannot read properties of undefined — fixing the symptom with a null check instead of the root cause. Fix: trace the data flow to find where undefined originates.
- ⚠Error: no preventive test added — "fix works but same bug regresses next refactor". Fix: add a regression test that reproduces the original error.
- ⚠Error: trial-and-error debugging — "changed code until it worked without understanding why". Fix: require a root-cause explanation before any code change.
Best Practices
- ✓Always trace back to the root cause before writing a fix — understanding precedes fixing.
- ✓Add a regression test that reproduces the original bug, then verify the fix makes it pass.
- ✓Document the root cause in the commit message so future developers understand the context.
FAQ
What is this prompt for and why use it?
Diagnose cache invalidation and stale data issues in TypeScript code. According to the Stack Overflow 2024 survey, 76% of developers use or plan to use AI tools, and AI-assisted debugging reduces mean-time-to-resolution by 40% for cache invalidation and stale data issues. Systematic diagnosis of cache invalidation and stale data
When should I use this prompt?
When encountering cache invalidation and stale data issues that is not immediately obvious from the error message alone. Do not use this prompt for errors with self-explanatory messages or one-line typo fixes.
How do I get the best results with this prompt?
Key tips: Provide the full stack trace — truncated traces hide the actual origin.; Include reproduction steps so the debugger can verify the fix resolves the issue.; Ask for a preventive test, not just a fix — tests stop regressions..
What common problems should I watch for?
Common problems: Error: TypeError: Cannot read properties of undefined — fixing the symptom with a null check instead of the root cause. Fix: trace the data flow to find where undefined originates.; Error: no preventive test added — "fix works but same bug regresses next refactor". Fix: add a regression test that reproduces the original error.; Error: trial-and-error debugging — "changed code until it worked without understanding why". Fix: require a root-cause explanation before any code change..
What are the best practices?
Recommended: Always trace back to the root cause before writing a fix — understanding precedes fixing.; Add a regression test that reproduces the original bug, then verify the fix makes it pass.; Document the root cause in the commit message so future developers understand the context..