Skip to content

Use None, not an empty string, as the keep-waiting sentinel - #1543

Merged
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1501
Aug 27, 2026
Merged

Use None, not an empty string, as the keep-waiting sentinel#1543
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1501

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #1501.

_database_id_in_url returned "" to mean "not on a database page yet, keep polling" and a database ID otherwise, both typed str. That overloads one type with two meanings, and it means an empty ID and no ID are the same value — so if the pattern ever could match an empty ID, the wait would poll for the full 180 seconds and then time out, with nothing to say why.

It now returns str | None. None is the sentinel, a str is always an ID, and the two cases are distinguishable at the type level.

To be accurate about the reported symptom: the pattern is (?P<database_id>[^/]+), so it cannot match an empty ID today, and the infinite-wait case is not reachable. This makes it unreachable by construction rather than by a property of the regex that a reader has to go and check.

The None check after the wait is # pragma: no coverWebDriverWait.until only returns a value it considers true, so it exists to narrow the type.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM

Closes #1501

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
@adamtheturtle
adamtheturtle merged commit 7b4d137 into main Aug 27, 2026
29 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vws-web-tools-issue-1501 branch August 27, 2026 06:21
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.

_database_id_from_current_url treats empty extracted ID as keep waiting

1 participant