Skip to content

feat: expose AttachmentQueue's AttachmentContext#985

Merged
stevensJourney merged 4 commits into
mainfrom
attachmnet-protection
Jun 9, 2026
Merged

feat: expose AttachmentQueue's AttachmentContext#985
stevensJourney merged 4 commits into
mainfrom
attachmnet-protection

Conversation

@stevensJourney

@stevensJourney stevensJourney commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Some AttachmentQueue users have a use case for custom saveFile methods. The attachmentService exposes a context to mutate attachment records in a safe manner. Unfortunately, the attachmentService is currently marked as private which means extending classes cannot access it.

The AttachmentsService contains functionality to watch active attachments and obtain an AttachmentContext via a mutex. Users won't likely need to watch the attachment state, but they could need an AttachmentContext - which exposes methods for reading and manipulating AttachmentRecords.

This makes AttachmentContext a public API and adds a small method to AttachmentQueue to access an AttachmentContext.

An example use case for requiring access is available at #983

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0bedefe

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

This PR includes changesets to release 7 packages
Name Type
@powersync/common Minor
@powersync/node Patch
@powersync/op-sqlite Patch
@powersync/react-native Patch
@powersync/tanstack-react-query Patch
@powersync/web 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

@simolus3 simolus3 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.

We need to run pnpm exec api-extractor run --local to update the API snapshot. Also AttachmentService should be marked as @alpha instead of @internal now since this makes it part of the public API.

@stevensJourney stevensJourney changed the title fix: expose AttachmentQueue's attachmentService member feat: expose AttachmentQueue's AttachmentContext Jun 9, 2026
@stevensJourney

Copy link
Copy Markdown
Collaborator Author

We need to run pnpm exec api-extractor run --local to update the API snapshot. Also AttachmentService should be marked as @alpha instead of @internal now since this makes it part of the public API.

It's nice to see the API Extractor in action! After properly examining the current state of the various components. I updated this PR to not expose AttachmentService directly, but rather add a small method to AttachmentQueue to expose a now public AttachmentContext.

@stevensJourney stevensJourney marked this pull request as ready for review June 9, 2026 07:49
@stevensJourney stevensJourney merged commit 93199a7 into main Jun 9, 2026
16 checks passed
@stevensJourney stevensJourney deleted the attachmnet-protection branch June 9, 2026 07:49
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