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

HotDeploymentWatchedFileBuildItem predicate not working when auto-build is enabled (vscode) #36472

Closed
ia3andy opened this issue Oct 13, 2023 · 6 comments · Fixed by #36520
Closed
Assignees
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Oct 13, 2023

Describe the bug

Currently, Quarkus is looking for modification between the target and the source (when using a HotDeploymentWatchedFileBuildItem.locationPredicate):
https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java#L913-L914

When using a static location, then it compare a timestamp registered locally (which works):
https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java#L968

When auto-build is enabled (vscode), the target file and the source file are the same after a modification and the change is not detected by Quarkus.

Expected behavior

Change should be detected with the HotDeploymentWatchedFileBuildItem.locationPredicate

Actual behavior

Change is not detected

How to Reproduce?

https://github.com/ia3andy/web-bundler-jquery

Open with vscode (java enabled), start dev mode and change something in src/main/resources/web/... (reload)

@ia3andy ia3andy added the kind/bug Something isn't working label Oct 13, 2023
@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 13, 2023

cc @mkouba

@mkouba mkouba self-assigned this Oct 13, 2023
@mkouba
Copy link
Contributor

mkouba commented Oct 13, 2023

Hm, I wonder if this could ever work... anyway, I'll take a look next Monday.

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 13, 2023

@mkouba maybe we should fill the timestampSet.watchedFileTimestamps with the resources matching the predicate at startup.

@mkouba
Copy link
Contributor

mkouba commented Oct 16, 2023

So I looked into the code and it worked in my test by coincidence 🤦. A HotDeploymentWatchedFileBuildItem with a predicate is only considered when a new file is created. In my test this solved the problem with a new template added to the app because subsequent restarts were handled by the location-based HotDeploymentWatchedFileBuildItem produced by the Qute extension.

maybe we should fill the timestampSet.watchedFileTimestamps with the resources matching the predicate at startup.

Yes, something like that. But I need to look at the code again. It's not exactly straightforward.

mkouba added a commit to mkouba/quarkus that referenced this issue Oct 17, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 17, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 18, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 24, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 24, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 25, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 27, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
mkouba added a commit to mkouba/quarkus that referenced this issue Oct 30, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Nov 6, 2023
@ia3andy
Copy link
Contributor Author

ia3andy commented Nov 6, 2023

Thanks @mkouba this was an adventure :)

@ia3andy
Copy link
Contributor Author

ia3andy commented Nov 6, 2023

@fbricon this is fixing the bug you experienced on vscode :)

DavideD pushed a commit to DavideD/quarkus that referenced this issue Nov 27, 2023
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
- also mention the glob pattern in HotDeploymentWatchedFileBuildItem
javadoc and optimize glob pattern processing
- fixes quarkusio#36472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants