Skip to content

Conversation

@codeskyblue
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 19, 2025 01:37
Copilot finished reviewing on behalf of codeskyblue November 19, 2025 01:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces bidirectional pipe functionality for async socket and WebSocket communication, enabling data transfer between different connection types. The implementation adds a new pipe.py module with protocol definitions and wrapper classes.

Key Changes:

  • Added pipe_duplex() function and AsyncDuplex Protocol for async bidirectional I/O
  • Implemented SocketDuplex and WebSocketDuplex wrapper classes for unified async interfaces
  • Updated type annotations in android.py to accurately reflect return types

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 16 comments.

File Description
uiautodev/remote/pipe.py New module implementing async duplex piping with Protocol definition and socket/WebSocket wrapper classes
uiautodev/router/android.py Added Union type import and updated shell function return type annotation
uiautodev/remote/scrcpy.py Minor formatting improvement (added blank line)
uiautodev/command_proxy.py Added redundant int() casts for additional type safety in tap coordinates
Comments suppressed due to low confidence (3)

uiautodev/remote/pipe.py:79

  • Except block directly handles BaseException.
        except:

uiautodev/remote/pipe.py:84

  • Except block directly handles BaseException.
            except:

uiautodev/remote/pipe.py:139

  • 'except' clause does nothing but pass and there is no explanatory comment.
            except Exception:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +139 to +140
except Exception:
pass No newline at end of file
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Bare except Exception: without logging or handling the specific exception makes debugging difficult. Consider logging the exception or handling specific exception types (e.g., ConnectionError, RuntimeError) for better error visibility.

Copilot uses AI. Check for mistakes.

import logging
from typing import Dict, Optional
from typing import Dict, Optional, Union
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Import of 'Dict' is not used.
Import of 'Optional' is not used.

Suggested change
from typing import Dict, Optional, Union
from typing import Union

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 84
except:
pass
if not self._same:
try:
self.wsock.close()
except:
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except:
pass
if not self._same:
try:
self.wsock.close()
except:
except:
# Ignore exceptions during socket close (e.g., already closed)
pass
if not self._same:
try:
self.wsock.close()
except:
# Ignore exceptions during socket close (e.g., already closed)

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 84
except:
pass
if not self._same:
try:
self.wsock.close()
except:
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except:
pass
if not self._same:
try:
self.wsock.close()
except:
except:
# Ignore errors during rsock close; socket may already be closed or invalid.
pass
if not self._same:
try:
self.wsock.close()
except:
# Ignore errors during wsock close; socket may already be closed or invalid.

Copilot uses AI. Check for mistakes.

def _start_scrcpy3(self):
device = self._device
version = self.VERSION
Copy link
Collaborator

Choose a reason for hiding this comment

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

version = self.VERSION,这个version没用上

@codeskyblue codeskyblue merged commit 54bf3b9 into master Nov 22, 2025
6 checks 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.

3 participants