Skip to content
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

Fix next, previous, first, and last bugs in document Link header #2

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

zfletch
Copy link
Member

@zfletch zfletch commented Oct 18, 2019

Fix a few bugs in the Fragment#*_fragment methods. These bugs were pointed out by @balmas in point 5 in her comment here.

  • Do not include parent: parent in the where clauses; the last fragment should be the last one in the entire text not in the book/chapter/etc.
  • Use > rank and < rank instead of rank: rank + 1 and rank: rank - 1; sometimes the next or previous fragment is separated by a distance greater than 1.
  • Add missing tests!

Fix a few bugs in the `Fragment#*_fragment` methods. These bugs
manifested themselves in the `Link` header of the `/documents`
endpoints.

* Do not include `parent: parent` in the `where` clauses; the last
  fragment should be the last one in the entire text not in the
  book/chapter/etc.
* Use `> rank` and `< rank` instead of `rank: rank + 1` and `rank: rank
  - 1`; sometimes the next or previous fragment is separated by a
  distance greater than `1`.
* Add missing method tests in `Fragment`.
@zfletch zfletch force-pushed the rel-prev-next-absolute branch from 64893ef to f56e204 Compare October 21, 2019 16:11
@zfletch zfletch merged commit 1fd10c1 into master Oct 21, 2019
@zfletch zfletch deleted the rel-prev-next-absolute branch October 21, 2019 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant