Search index not refreshed after branch switch? #11891
Comments
have you used brackets file tree exclude? how many files does the project have. |
I'm using file tree exclude to ignore node and bower (and the build folder). On the console nothing is printed. |
can you paste the health report after you have executed find in files/instant search? |
Sure, here the log with extensions loaded:
I've also done the test restarting brackets without extensions to make sure it's not an extension fault.
|
I tested this out and the index is updated on branch switch and the search results are updated too as soon as the branch switch occurs. Can you restart brackets[exit and relaunch- not just reload] and see if that helps? |
I've already restarted it several times. |
Does this happen in smaller projects? |
I'll try today |
@abose I've been seeing this sporadically ever since "instant search" landed. I emailed @nethip about it a long time ago (when the feature first landed) but since it doesn't repro all the time it's a little hard to pin down. I inspected the code For example if you click a search result, you'll actually see it highlight the wrong text range in the file. Or if you know a result is missing from a certain file, you can open it and see the missed result right there. So the filesystem code spotted the change on disk and updated the cache on the Brackets/CEF side -- it's just the cache on the Node side that missed the change. |
One thing to look at possibly is what the Node side does when it's unable to immediately reread a file that has changed or been created. Git checkouts might create enough notification churn that a file is missing or locked by the time Node tries to read it, even if the file might get recreated later in the checkout. Is there any possibility of cases where the Node side gives up on a whole queue of files to read just because one failed? Or race conditions where JS sees several changes to a file (including a delete + re-add) and Node ignores the file because it can't read it but the re-add isn't added to the queue because Node thinks it's still already in the queue to stuff to read? |
In any event, marking as a high priority since it erodes trust in the search feature. It's made me tempted to comment instant search to disable it, or use other tools for Find in Files a few times -- and I'm more forgiving of Brackets than the average user :-) Lmk if you disagree with that priority call. |
Oh, and fwiw I do not use the file system exclude plugin. |
I just went through the code again, and on file system change events, The list of changed file names is sent to node; which will remove it from node cache. The file read will not happen at the time. It happens only when the next time a search requests for file contents. So the When this happens, close find in files panel.Redo the search for the same query. Does it show the new results after that? |
I'm also seeing this. After switching branches I can't find new code that is on that branch.. even if I'm looking at it. however I also can't find code from the branch I just left, so it isn't searching the old branch either |
Do you see any console logs? |
If I open a git project, then I checkout a different branch, and I try to search for a string (which is present only in the new branch), the search results will be 0 even if the string actually exists.
Seems like that when I switch branch, Brackets doesn't update its index or something like that...
Note that my repository is quite big
The text was updated successfully, but these errors were encountered: