Repository navigation
fix(devloop): keep resource edits made since app start when re-seeding - #25958
Conversation
A pom edit that changes the module set rebuilds the change baseline while the app runs. Sources and frontend files newer than the app's start were already kept out of that baseline, but resources were not, so an application.properties edit in the same batch was taken as acted on: the re-resolve had copied it onto the classpath, apply reported Stable without restarting, and no later apply could see it again. Fixes #25956
|
@totally-not-ai is the issue already fixed in #25851 pull request? |
|
@tltv No, #25851 doesn't fix this, although it touches the same method. #25851 changes what the resource baseline stores: a content digest next to the stamp, so a build that rewrites a file with identical bytes is no longer counted as a change. But its This PR adds what's missing: the start-time cutoff that sources and frontend files already have ( One detail for whoever merges them: #25851 keeps unreadable resources in the inventory on purpose, so deletions can still be reported. Following that idea, resources newer than the app's start could also be kept as inventory keys, but with a marker that can never match (no stamp or digest), rather than left out entirely. Then a file edited and deleted before the next apply would also be reported as a deletion. That edge case isn't handled today, and I haven't changed code for it in this PR. |
|
|
Documentation Bot: No documentation needed for this change. This is a bug fix in the dev loop daemon's internal, package-private Nothing was opened in vaadin/docs. If you disagree, the change has to be documented by hand there.
|
#25958) (CP: 25.3) (#25987) This PR cherry-picks changes from the original PR #25958 to branch 25.3. --- #### Original PR description > ## Summary > If you edit a pom and `application.properties` at the same time while the app runs, the dev loop could lose the properties edit. It never restarted the app to pick it up. With this fix, resource files changed after the app started are no longer marked as already handled when the baseline is rebuilt. > > Fixes #25956 > > ## What changed > - **Behavior change:** A pom edit that changes the module set rebuilds the change baseline while the app runs. During that rebuild, `Compile.seedResources` now skips resources modified after the app started. Before, only sources and frontend files were skipped. So a resource edit in the same batch was treated as done. The Maven re-resolve had already copied it onto the classpath, apply reported "Stable" without a restart, and no later apply saw the edit again. Now the edit shows up as a startup resource change and triggers a restart. This only affects dev loop users who edit resources together with the pom. > - The no-argument `seedResources()` works as before (it seeds everything). > - Internal change only: `Compile` is package-private, so there are no public API changes. > > ## Test summary > **Resource re-seeding (Compile):** > - Config edited after app start reported as a startup change after re-seed, even when its classpath copy is up to date > - Resources the app started with stay seeded (no live changes reported) Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com> Co-authored-by: Tomi Virtanen <tltv@vaadin.com>
|
This ticket/PR has been released with Vaadin 25.4.0-alpha1. |



Summary
If you edit a pom and
application.propertiesat the same time while the app runs, the dev loop could lose the properties edit. It never restarted the app to pick it up. With this fix, resource files changed after the app started are no longer marked as already handled when the baseline is rebuilt.Fixes #25956
What changed
Compile.seedResourcesnow skips resources modified after the app started. Before, only sources and frontend files were skipped. So a resource edit in the same batch was treated as done. The Maven re-resolve had already copied it onto the classpath, apply reported "Stable" without a restart, and no later apply saw the edit again. Now the edit shows up as a startup resource change and triggers a restart. This only affects dev loop users who edit resources together with the pom.seedResources()works as before (it seeds everything).Compileis package-private, so there are no public API changes.Test summary
Resource re-seeding (Compile):