weichenw / obsidian-hypothesis-plugin

An Obsidian.md plugin that syncs highlights from Hypothesis.
MIT License
235 stars 20 forks source link

Refactor API methods #38

Closed phgn0 closed 2 years ago

phgn0 commented 2 years ago

Refactor the Hypothesis API communication code, to remove boilerplate and make changes easier. This is helpful for me to implement additional methods for bi-directional annotations syncing in my fork.

With this, annotations are always iterated through search_after (not limit), which fixes the edge case of missing annotations in later syncs. I wrangled the Hypothesis API for another project before, and this seems to be the best way to work around the pagination issues.