url_ok() in _http.py is dead code after #19 #22
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
paul_loth/krautspaceTV#22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The #19 fix (removing the redundant network call from `is_available()` in mastodon.py, train.py, and matrix.py) removed the last remaining callers of `url_ok()` in `backend/slides/_http.py`. It's no longer referenced anywhere:
```
$ grep -rn "url_ok" backend/
backend/slides/_http.py:22:async def url_ok(url: str, headers: dict | None = None, timeout: float = 3.0) -> bool:
```
Suggested fix
Remove `url_ok()` from `backend/slides/_http.py`, and update the module docstring (which currently says "Several slide types ... independently implement near-identical ... boilerplate for both is_available() and render()") since that's no longer accurate post-#19 — `fetch_json()` is still used by `render()` in all the API-backed slide types, but the is_available()-side duplication this file was originally solving for is gone now that those checks are cheap config-only checks.
Where
`backend/slides/_http.py:22-29` (and the module docstring at the top of the file)
Fixed and deployed. Removed the now-unused url_ok() from _http.py and updated the module docstring to reflect that only fetch_json() remains, used by render() in the API-backed slide types. Zero remaining references confirmed via grep; full test suite (71/71) still passes.