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

Blacklist .git/FETCH_HEAD in the watcher #731

Closed
juspky opened this issue Apr 26, 2020 · 9 comments · Fixed by #1183
Closed

Blacklist .git/FETCH_HEAD in the watcher #731

juspky opened this issue Apr 26, 2020 · 9 comments · Fixed by #1183
Labels
effort/easy needs/investigation Possibly an issue, needs more analysis/research type/feat Add a new capability or enhance an existing one

Comments

@juspky
Copy link

juspky commented Apr 26, 2020

Perceived Problem

Some Git clients like GitKraken auto refetch your repo.
This causes the watcher to randomly restart while GitKraken is open.

● nexus:dev:watcher restarting -- type: 'add' file: '.git/FETCH_HEAD'

Ideas / Proposed Solution(s)

Blacklist .git folder or possibly only .git/FETCH_HEAD if changes in .git are desired to be watched

@juspky juspky added the type/feat Add a new capability or enhance an existing one label Apr 26, 2020
@Weakky
Copy link
Collaborator

Weakky commented May 7, 2020

Hey 👋, thanks for reporting that bug. Unfortunately, I could not reproduce it.

The watcher should already be ignoring dot folders as you can see here https://github.com/graphql-nexus/nexus/blob/master/src/lib/watcher/watcher.ts#L91

What OS are you on?

@jasonkuhrt jasonkuhrt added the needs/clarification Unable to answer question/feature without more info label May 8, 2020
@juspky
Copy link
Author

juspky commented May 14, 2020

This happened to me on OSX while using GitKraken

@jasonkuhrt
Copy link
Member

@juspky are you able to reliably reproduce on your side?

@juspky
Copy link
Author

juspky commented May 16, 2020

yes I just tried it out with the latest -next release

@jasonkuhrt
Copy link
Member

Thanks @juspky we'll try to create a repro again.

@jasonkuhrt jasonkuhrt added needs/investigation Possibly an issue, needs more analysis/research and removed needs/clarification Unable to answer question/feature without more info labels May 16, 2020
@SpaceK33z
Copy link
Contributor

Hey, I created a repository to reproduce this issue; https://github.com/SpaceK33z/graphql-nexus-watcher-issue

This issue started happening when I switched to use Next.js as "server". It will also restart on all changes in the .next folder, which is quite a lot.

@jasonkuhrt
Copy link
Member

@SpaceK33z thanks!

Realize we need another feature, which is augmenting the watcher ignore from without app settings. While plugins can do this, user should be able to drop in augment as needed. E.g. we don't have a nextjs plugin for nexus yet.

@SpaceK33z
Copy link
Contributor

SpaceK33z commented Jun 30, 2020

@jasonkuhrt thanks for your comment. I not only have it with files in .next though, but also with .git files (same as TS). From the code Weakky linked above I gather that all folders starting with a dot should be ignored and that is apparently not happening. The repo I linked above also shows how to reproduce it with .git files btw!

@SpaceK33z
Copy link
Contributor

I'm pretty sure I found a fix! Pls test out #1183!

jasonkuhrt pushed a commit that referenced this issue Jul 7, 2020
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>

closes #731
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/easy needs/investigation Possibly an issue, needs more analysis/research type/feat Add a new capability or enhance an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants