Repository navigation
fix(library-sync): read page restriction from both response shapes - #981
Conversation
|
Severity: Medium — useShapeshift.ts:161: Removing export polling leaves the drawer stuck with missing or stale downloads when the job finishes before files are published. The single completion refetch can also return the server’s cached manifest. Restore bounded polling and confirm file availability before announcing exports are ready. Severity: Medium — useShapeshift.ts:127: Completion now compares a server timestamp against browser |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Treating Semi-Private pages as public bypasses their explicit browse restriction.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates library synchronization to recognize both CXOne restriction response shapes.
Changes:
- Reads nested or bare page restrictions.
- Expands accepted restrictions and raises rejection logging to warnings.
- Adjusts a Shapeshift log message.
| File | Description |
|---|---|
server/api/services/library-sync-service.ts |
Updates restriction parsing and sync eligibility. |
server/api/services/shapeshift-service.ts |
Changes log punctuation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`isSyncable` read the restriction only as `security["permissions.page"].restriction`,
the shape `GET /pages/{id}` returns. `GET /pages/{id}/find` returns a bare
`restriction` string and no `security` key, so every page the nightly walk found
was rejected as having "no security property" (0 of 139 med/Bookshelves
coverpages). The run then imported nothing and failed on "Failed to write any
books to the database". `pageRestriction` now reads either shape.
Rejection logs also move from debug to `commonsSyncLog.warn`.
8665b45 to
c7e947c
Compare
|
🎉 This PR is included in version 2.154.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |


isSyncableread the restriction only assecurity["permissions.page"].restriction, the shapeGET /pages/{id}returns.GET /pages/{id}/findreturns a barerestrictionstring and nosecuritykey, so every page the nightly walk found was rejected as having "no security property" (0 of 139 med/Bookshelves coverpages). The run then imported nothing and failed on "Failed to write any books to the database".pageRestrictionnow reads either shape.Rejection logs also move from debug to
commonsSyncLog.warn.