Skip to content

Ignore ClosedByteChannelException in CalendarFetcher#701

Merged
sunkup merged 2 commits into
devfrom
700-ignore-closedbytechannelexception-and-protocolexception
Sep 11, 2025
Merged

Ignore ClosedByteChannelException in CalendarFetcher#701
sunkup merged 2 commits into
devfrom
700-ignore-closedbytechannelexception-and-protocolexception

Conversation

@sunkup

@sunkup sunkup commented Sep 10, 2025

Copy link
Copy Markdown
Member

Purpose

Ignore ClosedByteChannelException which is thrown ProtocolException is thrown which happens when when servers misbehave and for example send more bytes than expected.

Short description

  • catch and ignore ClosedByteChannelException

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@sunkup sunkup self-assigned this Sep 10, 2025
@sunkup sunkup added the bug label Sep 10, 2025
@sunkup sunkup linked an issue Sep 10, 2025 that may be closed by this pull request
@sunkup sunkup requested a review from Copilot September 10, 2025 13:50

Copilot AI 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.

Pull Request Overview

This PR addresses server misbehavior by gracefully handling ClosedByteChannelException in the calendar fetching process. The exception occurs when servers send more bytes than expected, causing protocol errors that should be ignored rather than propagated as failures.

  • Adds exception handling for ClosedByteChannelException to prevent crashes from server protocol violations
  • Logs the ignored exception for debugging purposes while allowing the application to continue

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread app/src/main/java/at/bitfire/icsdroid/CalendarFetcher.kt
@sunkup sunkup requested a review from ArnyminerZ September 10, 2025 13:52
@sunkup sunkup added this to the 2.4.1 milestone Sep 10, 2025

@ArnyminerZ ArnyminerZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, sounds fair enough. Feel free to merge

@sunkup sunkup merged commit 6de85aa into dev Sep 11, 2025
8 checks passed
@sunkup sunkup deleted the 700-ignore-closedbytechannelexception-and-protocolexception branch September 11, 2025 10:42
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.

Ignore ClosedByteChannelException and ProtocolException

3 participants