Skip to content

Attachments Helper #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Attachments Helper #35

wants to merge 40 commits into from

Conversation

stevensJourney
Copy link
Contributor

@stevensJourney stevensJourney commented Apr 8, 2025

Overview

Attachments helper for Swift. The logic here is a port of powersync-ja/powersync-kotlin#159.

It should technically be possible to use the Attachments logic from the core module in the Swift SDK. However, the SKIEE conversion does not handle Swift exceptions and Flows well. There are work-arounds to mitigate this, but implementing those workarounds feels like it makes the Kotlin attachment helper unnecessarily complex. Porting the code to a pure Swift implementation gives a cleaner and simpler attachment helper which does not require glue code to Kotlin types.

DEMO

Syncing attachments between iOS and MacOS devices

SwiftAttachmentsDemo.mp4

TODOS

  • README
    • Updates from Kotlin README
  • Add camera functionality to demo
  • Improve locking - align with Kotlin implementation
  • Add ability to stop/pause attachment syncing

@stevensJourney stevensJourney requested a review from Copilot April 16, 2025 08:27
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.

Copilot reviewed 32 out of 35 changed files in this pull request and generated 2 comments.

Files not reviewed (3)
  • Demo/PowerSyncExample.xcodeproj/project.pbxproj: Language not supported
  • Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: Language not supported
  • Demo/PowerSyncExample.xcodeproj/xcshareddata/xcschemes/PowerSyncExample.xcscheme: Language not supported

@stevensJourney stevensJourney requested a review from Copilot April 16, 2025 13:23
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.

Copilot reviewed 33 out of 36 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • Demo/PowerSyncExample.xcodeproj/project.pbxproj: Language not supported
  • Demo/PowerSyncExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: Language not supported
  • Demo/PowerSyncExample.xcodeproj/xcshareddata/xcschemes/PowerSyncExample.xcscheme: Language not supported

@stevensJourney stevensJourney marked this pull request as ready for review April 16, 2025 13:29
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