Commit 376d6b7
committed
Fix bug with reimporting test cases
When re-importing a test database, if the source archive for that
database is not in the workspace, then old source code will be seen when
inspected.
To reproduce:
1. Run a ql test file with a failure (I'm using a javascript DB).
2. Right click and import on the db that sticks around.
3. Change the JS source file for the test.
4. Re-run and still have a failure.
5. Re-import the database
6. Run the query under test
7. Click on a result item
8. **BUG:** The source code is old
The problem is that the source archive cache is not being flushed in
this case. I added a case to flush the source archive when the archive
was imported into the workspace as a folder, but not when the archive is
external.
The fix is to listen for database remove events in the archive
filesystem provider and flush the associated database source
archive.
There is a complication:
The database remove event didn't emit the removed database. This is
because the only place that consumed the event didn't need it.
To get around this, I changed the structure of the events. I added a
new `fullRefresh` boolean. If true, then the original database change
handler will ensure the entire tree is refreshed. If false, only the
selected database.1 parent 233cb1c commit 376d6b7
File tree
5 files changed
+48
-26
lines changed- extensions/ql-vscode/src
- common/vscode
- databases
- local-databases
5 files changed
+48
-26
lines changedLines changed: 33 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
254 | 251 | | |
255 | 252 | | |
256 | 253 | | |
| |||
366 | 363 | | |
367 | 364 | | |
368 | 365 | | |
369 | | - | |
| 366 | + | |
| 367 | + | |
370 | 368 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
379 | 394 | | |
380 | 395 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 112 | + | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
| 616 | + | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
| |||
662 | 663 | | |
663 | 664 | | |
664 | 665 | | |
665 | | - | |
| 666 | + | |
666 | 667 | | |
| 668 | + | |
667 | 669 | | |
668 | 670 | | |
669 | 671 | | |
670 | 672 | | |
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
674 | | - | |
675 | | - | |
| 676 | + | |
676 | 677 | | |
| 678 | + | |
677 | 679 | | |
678 | 680 | | |
679 | 681 | | |
| |||
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
725 | | - | |
| 727 | + | |
726 | 728 | | |
| 729 | + | |
727 | 730 | | |
728 | 731 | | |
729 | 732 | | |
| |||
776 | 779 | | |
777 | 780 | | |
778 | 781 | | |
| 782 | + | |
779 | 783 | | |
780 | 784 | | |
781 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
950 | | - | |
| 950 | + | |
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
| |||
0 commit comments