Skip to content

Commit

Permalink
feat: added more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Aug 27, 2024
1 parent 55f626c commit b45cf68
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/api/src/libs/sync/collections/repairCollectionBooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ type Helpers = Parameters<NonNullable<DataSourcePlugin["sync"]>>[1]

const logger = Logger.child({ module: "sync/repairCollectionBooks" })

/**
* Try to repair books links
*
* @important
* We don't do the repair on client side automatically since these issues can
* appear during partial / incomplete / errored sync. We cannot reliably detect when
* we can do the repairs ourselves. The repairs can be safely done on sync or on repair
* page on the web app.
*
* @scenario 1
* The book does not exist anymore or is not attached to the collection but the collection
* still have the book attached. We need to remove it from the collection.
*
* @scenario 2
* The book has the collection attached but not the collection. We need to reattach it to the
* collection.
*/
export const repairCollectionBooks = async ({
helpers,
ctx,
Expand Down

0 comments on commit b45cf68

Please sign in to comment.