Commit 25fb4cf
authored
fix(code): disable diff computing when review tab is not active (#1493)
## Problem
random black screen / freezing / OOM issues:
- me
- https://posthog.slack.com/archives/C09G8Q32R6F/p1775212277963019
- #1485
i suspect it's related to the diff rendering...
1. file changes
2. file watcher sees it, emits an events
3. git queries are invalidated (getDiffCached, getDiffUnstaged)
4. review diffs have always-active observers on those queries, so they get refetched
5. refetch returns a full repo diff, which is then parsed and diff components re-render
<!-- Who is this for and what problem does it solve? -->
<!-- Closes #ISSUE_ID -->
## Changes
disables the diff queries when the review tab is not active
<!-- What did you change and why? -->
<!-- If there are frontend changes, include screenshots. -->
## How did you test this?
manually
<!-- Describe what you tested -- manual steps, automated tests, or both. -->
<!-- If you're an agent, only list tests you actually ran. -->1 parent ea2b062 commit 25fb4cf
3 files changed
Lines changed: 14 additions & 5 deletions
File tree
- apps/code/src/renderer/features
- code-review
- components
- hooks
- panels/store
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
0 commit comments