Commit b38eaef
committed
fix(browser): reuse last network snapshot for browser network --detail
The previous browser network flow made follow-up inspection unstable.
`opencli browser network --detail <index>` could read a fresh capture batch instead of the list the user had just seen. That broke index alignment immediately after the first read, so users could not reliably inspect the request they selected from `browser network`.
Keep this fix in the CLI only and leave daemon/extension window-idle behavior unchanged.
- persist the last listed `browser network` snapshot in the browser cache directory
- make `--detail` load that snapshot first so indexes stay stable across follow-up inspection
- surface a usage error when the requested index is outside the cached snapshot
- add unit coverage for cached detail lookup and out-of-range indexes
Before:
- `opencli browser network` listed requests
- `opencli browser network --detail 3` could consume a different batch and make `3` point at the wrong request
After:
- `opencli browser network` lists requests and saves that snapshot
- `opencli browser network --detail 3` inspects request #3 from the same snapshot1 parent 44147e5 commit b38eaef
2 files changed
Lines changed: 147 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
54 | 72 | | |
55 | 73 | | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
| 79 | + | |
61 | 80 | | |
| 81 | + | |
62 | 82 | | |
63 | 83 | | |
64 | 84 | | |
| |||
69 | 89 | | |
70 | 90 | | |
71 | 91 | | |
| 92 | + | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
76 | 97 | | |
77 | 98 | | |
78 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
79 | 104 | | |
80 | 105 | | |
81 | 106 | | |
| |||
215 | 240 | | |
216 | 241 | | |
217 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
218 | 303 | | |
219 | 304 | | |
220 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
29 | 65 | | |
30 | 66 | | |
31 | 67 | | |
32 | 68 | | |
33 | 69 | | |
34 | | - | |
| 70 | + | |
35 | 71 | | |
36 | 72 | | |
37 | 73 | | |
| |||
522 | 558 | | |
523 | 559 | | |
524 | 560 | | |
525 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
526 | 581 | | |
527 | 582 | | |
528 | 583 | | |
| |||
549 | 604 | | |
550 | 605 | | |
551 | 606 | | |
552 | | - | |
| 607 | + | |
553 | 608 | | |
554 | 609 | | |
555 | 610 | | |
| |||
563 | 618 | | |
564 | 619 | | |
565 | 620 | | |
| 621 | + | |
| 622 | + | |
566 | 623 | | |
567 | 624 | | |
568 | 625 | | |
| |||
572 | 629 | | |
573 | 630 | | |
574 | 631 | | |
| 632 | + | |
575 | 633 | | |
576 | 634 | | |
577 | 635 | | |
578 | 636 | | |
579 | 637 | | |
580 | 638 | | |
581 | | - | |
| 639 | + | |
582 | 640 | | |
583 | 641 | | |
584 | 642 | | |
| |||
0 commit comments