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: [sc-30750] bug with Otzar Midrashim #2181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevekaplan123
Copy link
Contributor

Description

We noticed a bunch of infinite "Loading..." bugs on Otzar Midrashim. I discovered this bug exists on a few other indices as well -- because each of these indices has a depth 1 default node. The texts API for a ref returns next and previous section refs. The problem occurs when the next section is a default node. Most default nodes are depth 2, so when we return the next section ref, we return "{default node} 1", but when a default node is depth 2, we just return the name of the default node, which means we have no way of distinguishing it from its parent. The texts API then gets a request for the next section ref, which in this case comes before the current ref causing the client to get confused and to keep trying to hit the API.

Code Changes

When the texts API returns the next section ref, it calls next_section_ref, which simply needs special casing. In case we are dealing with a depth 1 default node, we convert the default node ref into a ranged segment ref so that it is not the identical string as the default node's parent.

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