-
Notifications
You must be signed in to change notification settings - Fork 0
fix: harden sync recovery and reviewer contracts #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -527,7 +527,11 @@ export class MemoryStore { | |
| } | ||
|
|
||
| public async getSyncState(): Promise<Required<SyncState>> { | ||
| return normalizeSyncState(await readJsonFile<SyncState>(this.paths.stateFile)); | ||
| try { | ||
| return normalizeSyncState(await readJsonFile<SyncState>(this.paths.stateFile)); | ||
| } catch { | ||
| return normalizeSyncState(null); | ||
| } | ||
|
Comment on lines
+530
to
+534
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't collapse every state-file read error into "empty state". Because Suggested narrowing public async getSyncState(): Promise<Required<SyncState>> {
try {
return normalizeSyncState(await readJsonFile<SyncState>(this.paths.stateFile));
- } catch {
- return normalizeSyncState(null);
+ } catch (error) {
+ const errno = error as NodeJS.ErrnoException;
+ if (error instanceof SyntaxError || errno.code === "ENOENT") {
+ return normalizeSyncState(null);
+ }
+ throw error;
}
}🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| public async markRolloutProcessed(identity: ProcessedRolloutIdentity): Promise<void> { | ||
|
|
||
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.
nitpick (typo): Consider removing the redundancy in "re-checked again".
"Re-checked" already implies "again". Consider using either "were checked again" or "were re-checked" for cleaner wording.