Skip to content

🏷️ fix(backend): drop the private proxy stub declarations - #331

Merged
gaborbernat merged 4 commits into
tox-dev:mainfrom
tridev-tej:tejesh/fix-backend-proxy-stubs
Oct 28, 2026
Merged

gaborbernat merged 4 commits into
tox-dev:mainfrom
tridev-tej:tejesh/fix-backend-proxy-stubs

Conversation

@tridev-tej

@tridev-tej tridev-tej commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The type stub for the backend proxy declared a _optional_commands() method the proxy does not have, and typed _exit() as returning None while the module returns 0. 🏷️ No typed code calls either: frontends send these private commands by name over the backend protocol. The stub now declares only the proxy's public surface, so it cannot drift from the private methods again.

Runtime behavior does not change.

tridev-tej and others added 2 commits October 25, 2026 06:23
The type checker is what catches a stub drifting from the module, so the
test only needs to call both methods through assert_type. Use a stdlib
module as the backend instead of a patched fake, and drop the checks
for _optional_commands, which only the old stub declared.
@gaborbernat gaborbernat added the bug Something isn't working label Oct 27, 2026
@gaborbernat gaborbernat changed the title Fix backend proxy type declarations 🏷️ fix(backend): match the proxy stub to the module Oct 27, 2026
@tridev-tej

Copy link
Copy Markdown
Contributor Author

Hi @gaborbernat, does this look ready to merge, or is there anything else I should change?

tridev-tej and others added 2 commits October 28, 2026 00:45
No typed code calls the proxy's private commands; the frontend sends them
by name over the backend protocol. Removing the declarations fixes the
wrong one without keeping a test that reaches into private methods.
@gaborbernat gaborbernat changed the title 🏷️ fix(backend): match the proxy stub to the module 🏷️ fix(backend): drop the private proxy stub declarations Oct 27, 2026
@gaborbernat
gaborbernat merged commit 5f5df96 into tox-dev:main Oct 28, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants