Commit 6b82e6c
committed
fix(mobile/search): revert drop-on-close — keep closed pads searchable
I had set tab.close to drop the pad's body from the content-search cache, on the theory that this stopped the "edited pad still matches old content" bug. But:
- The original stale-content bug was the WebView's HTTP cache returning the old /export/txt response. That's already fixed by `cache: 'no-store'` on the refresh fetch.
- Dropping on close threw away useful history. User just reported: open two pads (one with "Welcome" in the body), close both, search "welcome" — nothing comes up. Closed pads ARE a real switch target.
Reverted the close-side drop. The cache now retains last-known content for any pad we've ever opened in the session. Re-opening a pad immediately refreshes its cache via the open path; searching while a pad is open also refreshes via searchPadContent. So the only "stale" entries are pads the user closed and hasn't re-opened — those keep their last-known body for search, which is the intended behaviour.
Test rewritten to pin the new contract: open two pads, close both, search the welcome-only body — exactly the user's flow. Failed without this commit, passes with it.1 parent d9e8dde commit 6b82e6c
3 files changed
Lines changed: 37 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 202 | | |
213 | 203 | | |
214 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| |||
569 | 573 | | |
570 | 574 | | |
571 | 575 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
576 | 583 | | |
577 | 584 | | |
578 | 585 | | |
579 | | - | |
580 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
581 | 589 | | |
582 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
583 | 593 | | |
584 | 594 | | |
585 | 595 | | |
586 | 596 | | |
587 | 597 | | |
588 | 598 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | 599 | | |
595 | | - | |
596 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
597 | 603 | | |
598 | 604 | | |
599 | 605 | | |
| |||
0 commit comments