Skip to content

Fix SFTP session hang after authentication#29

Merged
VulcanoSoftware merged 1 commit into
mainfrom
fix-sftp-session-hang-10688922256061701937
Jul 6, 2026
Merged

Fix SFTP session hang after authentication#29
VulcanoSoftware merged 1 commit into
mainfrom
fix-sftp-session-hang-10688922256061701937

Conversation

@VulcanoSoftware

Copy link
Copy Markdown
Owner

Fixed a bug in the SFTP server implementation where the session would hang after successful authentication. The issue was caused by an incorrect implementation of the sftp_factory in asyncssh, which was returning an already-instantiated DCFSSFTPHandler instead of a callable (as expected by the library).

The fix involved:

  1. Modifying create_sftp_server in dcfs/app/sftp/__init__.py to make sftp_factory return a lambda that takes the SSHServerChannel and creates the handler.
  2. Updating DCFSSFTPHandler.__init__ in dcfs/app/sftp/handler.py to explicitly accept the channel and pass it to the asyncssh.SFTPServer base class.
  3. Adding a unit test tests/test_sftp_factory.py that mocks the asyncssh interaction to ensure the factory and handler are correctly initialized.

Verified the fix with a reproduction script and confirmed that existing tests still pass.


PR created automatically by Jules for task 10688922256061701937 started by @VulcanoSoftware

Fixed a bug where the SFTP session would hang after authentication because the `sftp_factory` was incorrectly returning an instance instead of a callable.

Changes:
- Updated `sftp_factory` in `dcfs/app/sftp/__init__.py` to return a lambda that accepts a channel.
- Updated `DCFSSFTPHandler.__init__` in `dcfs/app/sftp/handler.py` to explicitly accept and pass the channel to `super().__init__`.
- Added `tests/test_sftp_factory.py` to verify the factory and handler initialization logic.

Co-authored-by: VulcanoSoftware <113239901+VulcanoSoftware@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@VulcanoSoftware VulcanoSoftware marked this pull request as ready for review July 6, 2026 20:45
@VulcanoSoftware VulcanoSoftware merged commit cbfbd3b into main Jul 6, 2026
1 check passed
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