Skip to content

Some cleanup - #102

Merged
jourdain merged 19 commits into
masterfrom
some-cleanup
Oct 9, 2026
Merged

jourdain merged 19 commits into
masterfrom
some-cleanup

Conversation

@jourdain

@jourdain jourdain commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread tests/test_utils_extra.py Outdated

@Thibault-Pelletier Thibault-Pelletier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with trame-slicer and overall looks good to me.

I added a few comments on the tests. Like most Claude generated tests, a lot of them are too tightly coupled with implementation and may add some strain during maintenance.

If possible, it would be nice to trim them a bit to make them more easily human readable.

Comment thread tests/test_desktop.py Outdated
Comment thread tests/test_desktop.py Outdated
Comment thread tests/test_desktop.py Outdated
Comment thread tests/test_desktop.py Outdated
Comment thread tests/test_protocol.py Outdated
Comment thread .github/workflows/test_and_release.yml
jourdain and others added 18 commits October 8, 2026 11:39
asyncio.get_event_loop() warns on 3.12 and raises on 3.14 when no loop
is running, which broke create_task() before the server starts.
Add asynchronous.get_event_loop() mirroring wslink's loop selection and
use it in create_task, open_browser and the server exit path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run pytest on Python 3.10, 3.12 and 3.14 and include the version in
  the job name
- Use coverage source_pkgs so a local trame_server directory can not
  shadow the installed package
- Set ruff target-version to py310 to match requires-python

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Import Callable, Iterable and Iterator from collections.abc
- Use builtin type instead of typing.Type
- Make zip() strictness explicit (strict=False keeps current behavior)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use parenthesized context managers now that ruff targets py310.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clear_state_client_cache() raised KeyError for keys that were never
sent to the client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A response for a cancelled request (e.g. after a timeout) raised
InvalidStateError and a system message without a matching request
raised AttributeError. Both stopped the listen loop and disconnected
the client. In-flight entries are now always removed on response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add ConnectionStatus IntEnum (DISCONNECTED, CONNECTING, CONNECTED)
  which stays compatible with the previous 0/1/2 values
- connect() waits for the authentication response before reporting
  CONNECTED, so client_id is always available once connected
- connect() raises when the connection or authentication fails and
  always resets its state, so a failed attempt no longer leaves the
  client stuck in CONNECTING
- call_trigger() raises ConnectionError when not connected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a child server with a prefix, the untranslated names did not match
the cached keys, so nothing was cleared and unchanged values were never
sent again. Translate them like force_state_push does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- client: server errors, subscription callback errors (with traceback)
  and websocket errors are logged as errors, close events as debug
- protocol: JS errors without handler are logged as errors and missing
  triggers as warnings

Warnings and errors still reach stderr when no logging is configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TRAME_ARGS="--banner --no-http" leaked into every later test, so their
servers ran without static routes, and trame_net.log was written to
the repository root. Use monkeypatch and tmp_path instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The aiohttp router reordering hack no longer worked with aiohttp>=3.10,
which resolves routes through an index the hack never updated, so a
"/" route added in on_server_bind was shadowed by wslink's redirect.
wslink 2.5.8 registers its static routes on start, so routes added in
on_server_bind take precedence on any aiohttp version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use a raw WsLinkSession to observe what the server pushes instead of
corrupting the client state cache or inspecting private attributes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jourdain

jourdain commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

I think we are in a good spot now. Let me know if you are good with me merging it?

@Thibault-Pelletier

Copy link
Copy Markdown
Contributor

Yes, you can go ahead and merge it 👍

@jourdain
jourdain merged commit 40a9811 into master Oct 9, 2026
11 checks passed
@jourdain
jourdain deleted the some-cleanup branch October 9, 2026 15:28
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.

3 participants