Skip to content

fix(gitsync): dashboard edits right after a pull are committed and pushed - #133

Merged
vazra merged 1 commit into
mainfrom
fix/gitsync-rewrite-detection
Oct 12, 2026
Merged

vazra merged 1 commit into
mainfrom
fix/gitsync-rewrite-detection

Conversation

@vazra

@vazra vazra commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Bug: after each pull import, git sync treated every config write for ~1.2s (suppress window) as SimpleDeploy re-rendering the pulled file. A dashboard edit landing in that window was recorded as a "rewrite of pulled config": not committed or pushed with auto-push on, and on a later conflict the remote version won (for app settings the dashboard edit was then lost).

Fix: content instead of time. Right after importing a pull, git sync renders each imported app's simpledeploy.yml from the DB (new configsync.RenderAppSidecar) and records its SHA-256. A later write with exactly those bytes is the re-render, whenever it lands (the debounced write can come after any delay); any other write is a local edit and is committed and pushed normally. Requests made during the import itself are held and classified when it finishes. The 1.2s window is gone.

Also fixed (race detector, CI runs go test -race):

  • ApplyPending (Git Sync page "Apply now") ran fetch/rebase/apply on the API goroutine concurrently with the worker. It is now queued to the worker like a sync.
  • Status walked recent commits through the worker's go-git handle; it now uses its own handle.
  • TestDebouncedGlobalWritesBothFiles (configsync) slept a fixed 700ms for a 500ms debounce and flaked under load; it now polls.

Tests: TestDashboardEditRightAfterPullIsPushed (failed before: the edit never reached the remote). Existing guards still pass: pull rewrites still yield to later remote edits (pull-only), no rebound bot commit after a pull. Full go test -race ./... passes; 26b E2E passes.

…tent, not a time window

Every write within 1.2s of a pull import was treated as SimpleDeploy re-rendering the pulled file: a dashboard edit in that window was not committed or pushed, and on a later conflict the remote version won. Right after an import git sync now records the SHA-256 of each imported sidecar as rendered from the DB; only a write with exactly those bytes counts as the re-render, whenever it lands. Writes during the import itself are held and classified when it finishes.

Also: ApplyPending runs on the worker goroutine and Status reads recent commits through its own repository handle, since a go-git handle is not safe for concurrent use (race detector).
@vazra
vazra merged commit b1ac010 into main Oct 12, 2026
6 checks passed
@vazra
vazra deleted the fix/gitsync-rewrite-detection branch October 12, 2026 08:46
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.

1 participant