Skip to content

Conversation

stevensJourney
Copy link
Contributor

Overview

Related to powersync-ja/powersync-swift#69.

This removes some of the Swift specific error handling we perform in the core module, by adding some additional helpers to the PowerSyncKotlin module.

A small Result like interface is added to the Swift module in order for the Swift SDK to relay exceptions to the Kotlin codebase (throwing Errors directly on the Swift side is not a trivial exercise).

Copy link

@Copilot 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 improves Swift-Kotlin interoperability by removing Swift-specific error handling from the core module and adding helper classes to the PowerSyncKotlin module. The changes enable better exception handling between Swift and Kotlin codebases.

  • Removes catchSwiftExceptions wrapper function from the core database implementation
  • Adds PowerSyncResult sealed class and wrapper classes for bridging exceptions between Swift and Kotlin
  • Updates CHANGELOG to document the internal improvements

Reviewed Changes

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

File Description
core/src/commonMain/kotlin/com/powersync/db/internal/InternalDatabaseImpl.kt Removes Swift-specific exception handling from core database operations
PowerSyncKotlin/src/appleMain/kotlin/com/powersync/SDK.kt Adds imports for callback and transaction types
PowerSyncKotlin/src/appleMain/kotlin/com/powersync/Locks.kt Introduces PowerSyncResult and wrapper classes for Swift-Kotlin exception bridging
CHANGELOG.md Documents the internal Swift lock improvements

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

@stevensJourney stevensJourney marked this pull request as ready for review August 25, 2025 07:16
Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@simolus3 simolus3 merged commit 4a42e5f into main Aug 25, 2025
5 checks passed
@simolus3 simolus3 deleted the swift-lock-improvements branch August 25, 2025 07:56
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