Fix Notion sync checkpoint handling - #684
Open
iamakulov wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Notion sync checkpoint advancement so that collections don’t record a successful sync checkpoint when one or more items failed to import, preventing those failed items from being incorrectly treated as up-to-date.
Changes:
- Capture a conservative
syncStartedAttimestamp at the beginning of the sync to use as the next checkpoint on full success. - Only persist
PLUGIN_KEYS.LAST_SYNCEDwhen there are zero per-item sync errors; otherwise keep the previous checkpoint and surface a sync failure.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
iamakulov
force-pushed
the
codex/fix-notion-sync-checkpoint
branch
from
August 10, 2026 17:39
c188722 to
578b26a
Compare
kaloyanvi
approved these changes
Aug 11, 2026
| status: "partial" | ||
| succeeded: number | ||
| failed: number | ||
| total: number |
Collaborator
There was a problem hiding this comment.
Nit: do we need all 3, we can derive the total right?
|
|
||
| if (syncErrors.length > 0) { | ||
| return { | ||
| status: "partial", |
Collaborator
There was a problem hiding this comment.
Nit: it's bit strange that if all items error we still have "partial" status even though none succeeded
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.
This PR fixes a Notion sync bug where, when one or more items would fail to sync, we’d still treat the sync as successful and advance the checkpoint. The result of this would be that the failed items would stay outdated but would be treated as fresh (until you edit them again).
QAed by blocking one of the requests that the plugin makes to the Notion API to fetch a record.