Skip to content

fix/backport bytestream fixes#43

Merged
ralflang merged 2 commits intoFRAMEWORK_6_0from
fix/backport-bytestream-fixes
Apr 13, 2026
Merged

fix/backport bytestream fixes#43
ralflang merged 2 commits intoFRAMEWORK_6_0from
fix/backport-bytestream-fixes

Conversation

@ralflang
Copy link
Copy Markdown
Member

  • feat: Add connection tests
  • fix: backport community fixes from bytestream fork

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Apr 12, 2026

PR Summary

  • Initialization Enhancement
    The initialization process for the 'Horde_Imap_Client_Exception' has been updated to start with default values. This simplifies construction and saves time.

  • Data Type Assurance
    To make sure any values processed are integers, explicit integer casting has been applied, particularly in dealing with the 'Horde_Imap_Client_Ids' class and the '_fromSequenceString' method.

  • Improved Command Handling
    The handling of UIDs in the 'Horde_Imap_Client_Socket' class has been updated to better manage command length limits. This avoids instances of exceeding maximum command lengths, reducing error encounters.

  • Streamlined Exception Handling
    Exception handling processes have been upgraded in the '_sendCmdChunk' method. This streamlines how exceptions are caught and stored, making it easier to diagnose errors when they occur.

  • Accessible Timeout Error Messages
    Timeout error messages have been clarified in 'Horde_Imap_Client_Socket\Connection\Socket'. The correct timeout value is now referenced, making troubleshooting more efficient.

  • Efficient Date Conversion
    The process of converting 'tmp['Date']' to a string has been improved in the 'fetchCmd' section of 'Horde_Imap_Client\Socket\Pop3'. This optimizes the conversion speed and assures the right data type.

  • Added Destructor Method
    A new destructor method has been added to close the stream in 'Horde_Imap_Client\Tokenize'. This prevents unnecessary data usage and makes resource management more efficient.

  • Extended Test Coverage
    New test cases have been added to confirm the integer conversion on ID sequences and ranges and to validate the efficacy of the updated vanished command handling. This allows for more thorough quality checks and minimizes risks.

  • Enhanced Testing Tools
    The 'Socket' class in the test suite has received enhancements, offering new functionalities such as sending a command and managing a captured pipeline. This gives developers better testing tools and contributes to efficient debugging.

Original-Author: Anna Larch <anna@nextcloud.com> (Ids int cast, ceafee1)
Original-Author: Richard Steinmetz <richard@steinmetz.cloud> (Tokenize resource leak, e72ae63)
Original-Author: Daniel Kesselberg <mail@danielkesselberg.de> (Socket read timeout exception, 33dc825)
Original-Author: Daniel Kesselberg <mail@danielkesselberg.de> (Socket vanished chunking, 69a022d)
Original-Author: Kieran Brahney <kieran.brahney@gmail.com> (Pop3 null date cast, fed98c8)
Original-Author: Kieran Brahney <kieran.brahney@gmail.com> (Exception constructor defaults, bdb0e46)
Original-Author: Daniel Kesselberg <mail@danielkesselberg.de> (Connection debug message, f66eeb6)
Port 5 tests from bytestream fork to modern PHPUnit format:
- IdsTest: testForcedIntForRange, testForcedIntForSequence,
  testAddingWithForcedIntConversion (Anna Larch, ceafee1)
- SocketTest: testVanishedCommand, testVanishedCommandChunks
  (Daniel Kesselberg, 69a022d)

Fix pre-existing SocketTest bugs: assertFalse(instanceof) should
be assertInstanceOf — passed only because unqualified class name
resolved to wrong namespace.

Harden Tokenize __destruct/__clone interaction: nullify _stream
in __clone before throwing to prevent double-close TypeError.
@ralflang ralflang force-pushed the fix/backport-bytestream-fixes branch from f74100d to d5e5ae0 Compare April 13, 2026 03:53
@ralflang ralflang merged commit fead723 into FRAMEWORK_6_0 Apr 13, 2026
0 of 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.

1 participant