Skip to content

Add flush() method to SSHSocket, SSHClient, and SSHChannel#185

Merged
vicajilau merged 6 commits into
TerminalStudio:masterfrom
vicajilau:fix/keepalive-robustness
Jul 14, 2026
Merged

Add flush() method to SSHSocket, SSHClient, and SSHChannel#185
vicajilau merged 6 commits into
TerminalStudio:masterfrom
vicajilau:fix/keepalive-robustness

Conversation

@vicajilau

Copy link
Copy Markdown
Collaborator

This pull request introduces a new flush() method to the SSHSocket, SSHClient, and SSHChannel classes, allowing users to force the flushing of any buffered outgoing data. The implementation is propagated across the main library code, channel controllers, and test fakes to ensure consistent behavior and testability.

New flush functionality

  • Added a flush() method to the SSHSocket abstract class and implemented it in all concrete socket classes, including _SSHNativeSocket and SSHForwardChannel, to force flushing of buffered outgoing data.
  • Implemented flush() in SSHTransport to call the underlying socket's flush() method, ensuring transport-level flushing.
  • Added a flush() method to SSHClient that delegates to the transport layer, and passed this method into SSHChannelController for channel-level flushing.
  • Exposed a flush() method on SSHChannel that delegates to its controller, and updated SSHChannelController to support an optional onFlush callback and provide a flush() method.

Test support

  • Updated all relevant test fake socket classes to implement a no-op flush() method, ensuring compatibility with the new interface in tests.

Documentation

  • Updated CHANGELOG.md to document the addition of the flush() method to the public API.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.88%. Comparing base (f8cac95) to head (f83aae1).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
+ Coverage   55.42%   55.88%   +0.45%     
==========================================
  Files          66       66              
  Lines        5452     5470      +18     
==========================================
+ Hits         3022     3057      +35     
+ Misses       2430     2413      -17     
Flag Coverage Δ
unittests 55.88% <100.00%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/src/socket/ssh_socket.dart 100.00% <100.00%> (+100.00%) ⬆️
lib/src/socket/ssh_socket_io.dart 42.10% <100.00%> (+42.10%) ⬆️
lib/src/ssh_channel.dart 50.00% <100.00%> (+0.67%) ⬆️
lib/src/ssh_client.dart 24.56% <100.00%> (+1.61%) ⬆️
lib/src/ssh_forward.dart 76.19% <100.00%> (+3.96%) ⬆️
lib/src/ssh_session.dart 70.12% <100.00%> (+1.63%) ⬆️
lib/src/ssh_transport.dart 52.74% <100.00%> (+0.15%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vicajilau
vicajilau merged commit 233bfed into TerminalStudio:master Jul 14, 2026
3 checks passed
@vicajilau
vicajilau deleted the fix/keepalive-robustness branch July 14, 2026 06:19
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.

1 participant