Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning not being hidden on change to a non-protected branch #15

Closed
moloko opened this issue Oct 11, 2021 · 17 comments · Fixed by #17
Closed

Warning not being hidden on change to a non-protected branch #15

moloko opened this issue Oct 11, 2021 · 17 comments · Fixed by #17

Comments

@moloko
Copy link
Contributor

moloko commented Oct 11, 2021

In the screenshot below I have switched from master to a different branch (one that is not listed in branchwarnings.protectedBranches) but the status bar warning is not updating.

git-branch-warnings-issue

This was working fine for me as recently as last week - I think this started happening following update to VSC v1.61.0

@teledemic
Copy link
Owner

Hm, still works fine for me on 1.61.0.
Please provide info to reproduce or a PR if possible

@moloko
Copy link
Contributor Author

moloko commented Oct 11, 2021

@teledemic Oh, ok that’s odd. I’ll do some more digging tomorrow.

@moloko
Copy link
Contributor Author

moloko commented Oct 12, 2021

Still happening today... not 100% of the time but it is happening most of the time:

vscode-branch-warning-issue15.mp4

Even if I switch from master to another protected branch - rc - the message still reads 'WARNING: branch is master'

I'm running:
Version: 1.61.0
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:10:20.463Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 20.6.0

@moloko
Copy link
Contributor Author

moloko commented Oct 29, 2021

I finally had a chance to do a bit of debugging (with the caveat that this is my first time attempting to debug a VSC extension!) and - as far as I can see - the problem appears to be that the onDidChange event of the FileSystemWatcher doesn't appear to be firing (reliably/at all?) when I change branches.

I couldn't quite figure out why this should be - but I then spotted that someone logged this issue which seemed to be closely related... So I did a bit more digging and discovered that the v1.61 release of VSC introduced a new multi-platform file watcher - and it seems to be this that's blocking your extension from seeing changes to .git/HEAD - at least if I change back to the old file watcher by adding "files.legacyWatcher": true to my settings.json and restart VSC your extension starts working perfectly again.

If you're still not seeing this issue then I'm guessing it's got to be something os-specific - either to macOS or perhaps specific to the new 'Apple Silicon' hardware? I'll give it a try on my old Intel-processor mac at some point just to see what happens on that.

@josegutierro
Copy link

Same problem here with a new Apple Silicon Hardware. With my old Intel macbook was working perfectly.

@teledemic
Copy link
Owner

Thanks folks - sounds like it may be worth opening an issue on vscode that the new file watcher has a bug on M1 chips?

@moloko
Copy link
Contributor Author

moloko commented Nov 2, 2021

@josegutierro Ah OK interesting; I haven't managed to test it myself on my old Intel Mac yet as I haven't done any dev work on that for ages so naturally I need to spend a crazy amount of time trying to persuade it to get the command line developer tools running again so that I can actually use git... sigh

@teledemic Yeah clearly not your issue and so needs to be logged on the VSC GH (though might be worth keeping this issue open fpr now for the benefit of others) - is that something you're willing to do or would you like me to have a crack at it?

@moloko
Copy link
Contributor Author

moloko commented Nov 2, 2021

Same problem here with a new Apple Silicon Hardware. With my old Intel MacBook was working perfectly.

Ok so many, many hours of updates later and... I'm back up and running with Git and VSC on my old Intel MacBook Air - and I'm still getting this issue. And, as with my M1 Mac, enabling the 'legacy' file watcher makes it work fine.

@josegutierro perhaps it's down to the file system used? It's AFPS (Encrypted) on my Intel Mac. I'll need to check what my M1 Mac is using tomorrow.

@josegutierro
Copy link

Hello @moloko, I'm not able to get my old Intel Macbook to check the file system, but as far I remember it was working fine... Btw, my M1 Mac file system is APFS (Encrypted)

@moloko
Copy link
Contributor Author

moloko commented Nov 4, 2021

still an issue in VSC v1.62

@moloko
Copy link
Contributor Author

moloko commented Nov 18, 2021

@teledemic just in case you didn't spot this:

the workaround is to update downstream consumers to also listen to add events

If I can find some time over the coming weeks I'll try and give this a go

@teledemic
Copy link
Owner

Thx!

@braaar
Copy link

braaar commented Nov 26, 2021

I have experienced the same issue on a MacBook Pro (15-inch, 2016) (Intel processor)

OS: macOS Big Sur 11.6

"files.legacyWatcher": "on" in settings.json does nothing for me, it seems?

Screen.Recording.2021-11-26.at.12.21.28.mov

@moloko
Copy link
Contributor Author

moloko commented Nov 30, 2021

"files.legacyWatcher": "on" in settings.json does nothing for me, it seems?

That setting did work at one point but stopped working for me a couple of weeeks (??) ago.

Hopefully PR #17 will fix this

teledemic added a commit that referenced this issue Nov 30, 2021
add handler for file create/add events
@teledemic
Copy link
Owner

Ok thanks for your input everyone and especially @moloko for the PR! I just published 1.0.10 with #17 in it. I have no way to test as I do not have the issue, but chime in if it fixed or did not for you.

@moloko
Copy link
Contributor Author

moloko commented Nov 30, 2021

no problem @teledemic glad I was able to help out

@braaar
Copy link

braaar commented Dec 1, 2021

It works! Thank you!

Screen.Recording.2021-12-01.at.8.42.07.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants