Skip to content

Fix initial watch sync for existing files - #14031

Open
ousamabenyounes wants to merge 1 commit into
docker:mainfrom
ousamabenyounes:13725-fix-initial-sync
Open

Fix initial watch sync for existing files#14031
ousamabenyounes wants to merge 1 commit into
docker:mainfrom
ousamabenyounes:13725-fix-initial-sync

Conversation

@ousamabenyounes

Copy link
Copy Markdown

What I did

Fixes #13725.

develop.watch initial sync filtered host files by the service image's creation time. Existing files older than the image were therefore omitted at startup, even though later filesystem events synced them normally.

Initial sync now copies every eligible watched file, while preserving ignore and bind-mount filtering. The obsolete image-time lookup is removed.

Test verification

RED on upstream main (832673c8e445b5bf0bdb4963c7d7b3f81aa46da0):

TestInitialSyncFilesIncludesFilesOlderThanImage
paths: nil
expected: /app/src/test.txt
--- FAIL

GREEN with this change:

--- PASS: TestInitialSyncFilesIncludesFilesOlderThanImage
--- PASS: TestInitialSyncIncludesSingleFileOlderThanImage

The live Engine reproduction also changed from No such file or directory to successfully reading hello from /app/src/test.txt at watch startup.

Validation

Full local validation suite replayed on upstream and this branch:

  • golangci-lint run --build-tags e2e ./...0 issues
  • pkg/compose and all baseline-green unit packages pass
  • changed-line coverage gate passes
  • the same two container/inotify-dependent pkg/watch tests fail on both upstream and this branch; no new failures

Signed-off-by: Ben Younes <2910651+ousamabenyounes@users.noreply.github.com>
@ousamabenyounes
ousamabenyounes requested review from a team as code owners August 11, 2026 23:53
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 this pull request may close these issues.

[BUG] develop.watch initial_sync: true does not fire at container start

1 participant