Skip to content

Conversation

@jonkan
Copy link
Contributor

@jonkan jonkan commented Nov 4, 2025

A plain Task { ... } (e.g. not defered) inherits the actor’s executor and removing them doesn't change the current behavior. The fact that the functions are actor-isolated is enough to ensure the code won't run on the main actor.

Discussion
As long as we're fine with the file system operations being isolated to the same actor (i.e. functions will be able to block each other) this should be a simple and safe solution. The downside being that it might be less performant than some concurrent solution. Is this an issue?

I'm not sure it's trivial to implement an equally safe solution that supports parallell operations. E.g. what about related operations on/in the same file or directory?

Thoughts/input?

A plain Task { ... } (e.g. not defered) inherits the actor’s executor and removing them doesn't change the current behavior.
The fact that the functions are actor-isolated is enough to ensure the code won't run on the main actor.
@simolus3
Copy link
Contributor

simolus3 commented Nov 5, 2025

Given that these operations are only called from a single asynchronous function in SyncingService.handleSync that doesn't setup an outer task group / concurrency between attachments, I think we didn't have any concurrency here to begin with and these changes should be fine.

I suuppose if we wanted to add concurrency for syncing attachments, handleSync would be a better place to add it anyway

@simolus3 simolus3 merged commit 6939c94 into powersync-ja:main Nov 5, 2025
@jonkan jonkan deleted the remove-unnecessary-task-wrapping branch November 5, 2025 10:11
@stevensJourney stevensJourney mentioned this pull request Nov 6, 2025
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