-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sync): Support changing destination Notion database (#604)
* refactor: Rename `syncNote` to `syncNoteItem` * refactor: Extract `syncRegularItem` to its own file * refactor: Replace `SyncJob` class with functional approach * refactor: Move `ItemSyncError` class to `errors` directory * chore(zed): Add tasks for testing individual file and symbol * chore(zed): Simplify tasks by removing `args` field * refactor: Extract `normalizeID` Notion utility function * fix(sync): Recreate Notion pages when found in a different database * fix(sync): Reset synced notes when page ID changes Fixes #241
- Loading branch information
Showing
13 changed files
with
483 additions
and
184 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export class ItemSyncError extends Error { | ||
public readonly item: Zotero.Item; | ||
public readonly name = 'ItemSyncError'; | ||
|
||
public constructor(cause: unknown, item: Zotero.Item) { | ||
super(`Failed to sync item with ID ${item.id} due to ${String(cause)}`, { | ||
cause, | ||
}); | ||
this.item = item; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { ItemSyncError } from './ItemSyncError'; | ||
export { LocalizableError } from './LocalizableError'; | ||
export { MissingPrefError } from './MissingPrefError'; |
This file contains 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
This file contains 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
Oops, something went wrong.