Repository navigation
Conversation
erezrokah
approved these changes
Oct 13, 2026
Member
Author
|
Closing this.
An explicit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
state.Client.Closenow saves changes that were not flushed, so a source plugin that forgetsFlushno longer loses its incremental cursors without an error.Closedrops the changes instead when the context passed to the state client was cancelled for a reason other than quota. The sync stopped early, and moving the cursors forward would skip records that were never written.scheduler.Syncreturns an error only for cancellation, no tables, or max depth, so this matches the "flush unless the sync failed for a reason other than quota" rule that source plugins already follow.errors.As, because the monitor cancels withErrNoQuota{team: ...}. Theerrors.Is(cause, premium.ErrNoQuota{})check in plugins only matches an empty team name.Flushwith no pending changes no longer sends an empty insert, soFlushfollowed byClosewrites once.Clientinterface does not change. Plugins need no code change.Part of https://linear.app/env-zero/issue/ATL-340/fix-source-plugins-that-never-flush-the-state-client-silently-lose
go fmtto format your code 🖊golangci-lint run🚨TestStateClose*tests run against memdb. Each one fails when its behavior is removed: no flush onClose(got ""), flush without the context check (got "dropped"),errors.Isin place oferrors.As(got "").make testpasses.