-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add checkpoint loading for Contentstack sync initialization #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for reading and applying checkpoint files during the Contentstack sync initialization to resume from the last known state and avoid redundant fetches.
- Introduces
loadCheckpoint
andreadHiddenFile
functions for loading and parsing a JSON checkpoint. - Hooks checkpoint loading into the
init
lifecycle with fallback logic to a default file path. - Expands
config
schema with checkpoint options and bumps the package version.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/core/plugins.ts | Added try/catch around plugin loading to surface errors. |
src/core/index.ts | Implemented loadCheckpoint , readHiddenFile , and integrated checkpoint logic into init . |
src/config.ts | Added checkpoint settings (enabled , filePath , preserve ). |
package.json | Updated version from 2.0.11 to 2.1.0 . |
Comments suppressed due to low confidence (3)
src/core/index.ts:84
- The variable
checkPointConfig
has inconsistent capitalization; consider renaming it tocheckpointConfig
for consistency with the interface name.
const checkPointConfig: ICheckpoint = config.checkpoint
src/core/index.ts:122
- There are no unit tests covering the new
loadCheckpoint
andreadHiddenFile
behaviors; consider adding tests for successful load, fallback, missing file, and parse errors.
const loadCheckpoint = (checkPointConfig: ICheckpoint, paths: any): void => {
src/core/index.ts:54
- The
preserve
flag inICheckpoint
is neither documented nor implemented; add comments or implement its behavior, and correct formatting topreserve: boolean
.
preserve:boolean
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR introduces checkpoint file support during the Contentstack sync initialization. Key updates include:
These changes enhance resiliency and efficiency by enabling sync resume capabilities, reducing redundant content fetching on service restarts