Skip to content

PlatformService.executeIfSupportedAsync - HandshakeException crash#4531

Closed
aaravgarg wants to merge 1 commit intomainfrom
fix/ios-crash-handshake-exception
Closed

PlatformService.executeIfSupportedAsync - HandshakeException crash#4531
aaravgarg wants to merge 1 commit intomainfrom
fix/ios-crash-handshake-exception

Conversation

@aaravgarg
Copy link
Collaborator

Summary

  • Catch HandshakeException in PlatformService.executeIfSupportedAsync to prevent crash
  • Returns fallback value instead of crashing when TLS handshake fails during platform-specific async operations (analytics, Intercom, etc.)

Crash Stats

Test plan

  • Verify platform-specific async operations still work normally
  • Test with network issues (should return fallback, not crash)

🤖 Generated with Claude Code

Prevent crash when HandshakeException occurs during platform-specific
async operations (e.g. analytics, Intercom) by catching and returning
fallback value.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aaravgarg aaravgarg requested a review from mdmohsin7 February 1, 2026 23:15
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a crash caused by an unhandled HandshakeException during asynchronous platform-specific operations. The fix involves adding a try-catch block to gracefully handle this exception and return a fallback value. I've suggested a small improvement to make the error handling more robust by catching the more general IOException, which would prevent similar crashes from other network-related issues.

return await function();
try {
return await function();
} on HandshakeException {
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While catching HandshakeException fixes the specific crash reported, it would be more robust to catch the more general IOException. This would handle other network-related errors as well, such as SocketException (e.g., no internet connection) or other I/O errors, which seems to align with the goal of gracefully handling "network issues" as mentioned in the test plan. HandshakeException itself is a subtype of IOException.

Suggested change
} on HandshakeException {
} on IOException {

@mdmohsin7
Copy link
Member

closed in #4628

@mdmohsin7 mdmohsin7 closed this Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Hey @aaravgarg 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community! 💜

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.

2 participants