Skip to content

Conversation

@joshua-journey-apps
Copy link
Contributor

@joshua-journey-apps joshua-journey-apps commented Oct 7, 2025

This a port of the Swift, Dart and Kotlin attachment's API to the JS SDK.

This addresses the following issues #715 and #714 by adding the meta_data column to the table and persisting it in the attachments table.

It is currently still a work-in-progress so there are a couple things that still needs to be done:

  • Move attachment package to common
    • Move Node adapter under Node package
    • Move indexDB adapter under Web package
    • Move Expo adapter under RN package
  • Update demos
  • Improve testing
  • Update the README
  • Implement sync throttling
  • Complete clearing archived attachments
  • Removing some holdovers from the previous implementation
    • Supported file data format

@changeset-bot
Copy link

changeset-bot bot commented Oct 7, 2025

🦋 Changeset detected

Latest commit: ed32db1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@powersync/react-native Minor
@powersync/common Minor
@powersync/node Minor
@powersync/web Minor
@powersync/attachments Patch
@powersync/attachments-storage-react-native Minor
@powersync/adapter-sql-js Patch
@powersync/op-sqlite Patch
@powersync/tanstack-react-query Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

This looks like a good improvement so far. I've added some comments for some items I spotted.

joshuabrink and others added 17 commits October 27, 2025 15:49
- Added `getAttachment` method to retrieve an attachment by ID in AttachmentContext.
- Updated `upsertAttachment` to handle null values for optional fields.
- Introduced `generateAttachmentId` method in AttachmentQueue for generating unique IDs.
- Modified `watchActiveAttachments` to accept a throttle parameter.
- Added `deleteFile` method to have attachment deletion.
- Updated tests to cover new functionality and ensure reliability.
…ttachment sync operations

- Added AttachmentErrorHandler interface to manage download, upload, and delete errors for attachments.
- Updated AttachmentQueue and SyncingService to utilize the new error handler.
- Enhanced tests to verify error handling behavior during attachment sync processes.
@joshuabrink joshuabrink force-pushed the attachment-package-refactor branch from 671e23a to bea28d9 Compare November 12, 2025 09:15
@joshuabrink joshuabrink force-pushed the attachment-package-refactor branch from bea28d9 to e42ae45 Compare November 12, 2025 09:15
@stevensJourney
Copy link
Collaborator

Note: it looks like the attachments tests are failing here. Other Node.js tests should no longer be flaky. Please fix these new attachment tests before proceeding.

Chriztiaan
Chriztiaan previously approved these changes Jan 21, 2026
Copy link
Contributor

@Chriztiaan Chriztiaan left a comment

Choose a reason for hiding this comment

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

I am happy with this, the new docs make it easier to follow and implement too.

@joshuabrink joshuabrink force-pushed the attachment-package-refactor branch from 9a22452 to ea24510 Compare January 27, 2026 13:00
@joshuabrink joshuabrink force-pushed the attachment-package-refactor branch from ea24510 to 7adf99d Compare January 27, 2026 13:16
@joshuabrink joshuabrink merged commit d5c726d into main Jan 28, 2026
9 checks passed
@joshuabrink joshuabrink deleted the attachment-package-refactor branch January 28, 2026 14:30
@Chriztiaan Chriztiaan restored the attachment-package-refactor branch January 29, 2026 11:25
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.

6 participants