Skip to content

fix(devloop): keep resource edits made since app start when re-seeding - #25958

Merged
tltv merged 3 commits into
mainfrom
fix/devloop-keep-resource-edit-on-reseed
Sep 28, 2026
Merged

tltv merged 3 commits into
mainfrom
fix/devloop-keep-resource-edit-on-reseed

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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)

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
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 1 551 files  ±0   1 635 suites  ±0   1h 37m 49s ⏱️ - 3m 33s
12 466 tests +1  12 394 ✅ +1  72 💤 ±0  0 ❌ ±0 
12 865 runs  +1  12 793 ✅ +1  72 💤 ±0  0 ❌ ±0 

Results for commit 7dc87e1. ± Comparison against base commit a6533c6.

♻️ This comment has been updated with latest results.

@mshabarov
mshabarov requested a review from tltv September 28, 2026 07:29
@tltv

tltv commented Sep 28, 2026

Copy link
Copy Markdown
Member

@totally-not-ai is the issue already fixed in #25851 pull request?

@totally-not-ai

Copy link
Copy Markdown
Contributor Author

@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 seedResources() still records every resource on disk as already acted on, and it doesn't touch the re-seed after a module-set change in TransactionEngine.compileFor. In the scenario from #25956, the edited application.properties would be seeded with its new stamp and digest, and its classpath copy already holds the same bytes. So staleResources() would still report nothing, and apply would still end in Stable without a restart.

This PR adds what's missing: the start-time cutoff that sources and frontend files already have (seedResources(startedAtMillis)). The two PRs will conflict in seedResources(), and whichever lands second needs both parts: the digest from #25851 and the modified <= startedAtMillis filter from here.

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.

@tltv
tltv marked this pull request as ready for review September 28, 2026 07:53
@tltv
tltv enabled auto-merge September 28, 2026 07:54
@sonarqubecloud

Copy link
Copy Markdown

@tltv
tltv added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 7f48d45 Sep 28, 2026
58 checks passed
@tltv
tltv deleted the fix/devloop-keep-resource-edit-on-reseed branch September 28, 2026 08:26
@github-actions

Copy link
Copy Markdown
Contributor

Documentation Bot: No documentation needed for this change.

This is a bug fix in the dev loop daemon's internal, package-private Compile class: when a pom edit changes the module set and the resource baseline is rebuilt, a resource file (e.g. application.properties) edited in the same batch is no longer incorrectly marked as already handled, so it now correctly triggers a restart instead of being silently dropped. The existing dev loop documentation already describes this contract — batched edits are detected and reported honestly, and application.properties changes require a restart — the fix just makes the narrow pom+resource edge case match that documented behavior. There is no public API change and no new user-facing capability.

Nothing was opened in vaadin/docs. If you disagree, the change has to be documented by hand there.

Generated by Documentation Bot for #25958 · agent · 37.2 AIC · ⊞ 11.7K · ◷

vaadin-bot added a commit that referenced this pull request Sep 28, 2026
#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>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.4.0-alpha1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev Loop CLI: apply silently drops an application.properties change when the pom changes in the same batch

2 participants