Skip to content

Fix Spider Bio-Signal Search Query 422 Error #9131

@tobiu

Description

@tobiu

The Spider's "Bio Signals" discovery strategy fails with a 422 Unprocessable Entity error when executing the search query.

Error:

[Spider] Search Query: topic:women-in-tech OR topic:pyladies OR topic:django-girls OR topic:rails-girls stars:>5 (Sort: updated desc)
[GitHub] REST Request Failed (...): REST Error: 422 Unprocessable Entity

Cause:
The query string construction in Spider.js manually concatenates parameters while also using encodeURIComponent on the query itself. However, the GitHub.js service also expects a clean endpoint. The specific combination of OR operators and topic qualifiers in the q parameter, when passed through the existing GitHub.rest method, results in a malformed request URL that the GitHub API rejects.

Fix:
Refactor Spider.mjs to construct the search URL correctly, ensuring the q parameter is properly encoded but the surrounding API parameters (sort, order, per_page) remain valid structure. We should likely verify if GitHub.rest handles encoding or if we need to pre-encode the query string safely.

Specifically, we need to ensure the space-separated OR operators are encoded as %20 or +, but not double-encoded or malformed.

Metadata

Metadata

Assignees

Labels

aibugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions