rtd_enhanced_search.js hits v3 API without version, RTD returns stable results on non-stable builds
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- documentation, frontend
Research direction
Start with src/sunpy_sphinx_theme/theme/sunpy/static/js/rtd_enhanced_search.js and trace how the search request is built, how loaded RTD Addons metadata is read, and how later metadata updates are handled. Reproduce a search on a non-default documentation build; done means only the viewed project is version-pinned, external PR builds and unavailable metadata preserve existing behavior, and other projects retain their default versions.
Written by the indexing model from the issue text.
Description
In src/sunpy_sphinx_theme/theme/sunpy/static/js/rtd_enhanced_search.js, searches on indexed non-default documentation versions return results from the project’s default version, usually stable.
This affects projects using the SunPy theme, including Astropy through the Astropy unified theme. See astropy/astropy#19866.
Reproduction:
- Open an indexed non-default build, such as
/en/latest/or a tagged release. - Run a documentation search.
- Results link to
/en/stable/.
The RTD v3 search API ignores a separate &version=<slug> parameter. Version filtering must be included in q using project:<slug>/<version>.
The fix should:
- Pin only the currently viewed project.
- Leave other projects on their default versions.
- Read already-loaded RTD Addons metadata and listen for later updates.
- Avoid pinning external PR builds, which are not indexed.
- Preserve existing behavior when RTD metadata is unavailable.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 17
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sunpy/sunpy-sphinx-theme
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
sunpy/sunpy-sphinx-theme#337 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
sunpy/sunpy-sphinx-theme#321 · 1 comment ·
-
Enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sunpy/sunpy-sphinx-theme#308 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
sunpy/sunpy-sphinx-theme#300 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sunpy/sunpy-sphinx-theme#298 ·
All issues in sunpy/sunpy-sphinx-theme
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Design only Leadership Survey SLFS
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bcgov/digital-journeys#2293 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tursodatabase/turso#9405 ·
Maintainers usually reply within 1 day
-
Toolkit
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
API Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
Maintainers usually reply within 1 day