Skip to content

Attachment queue logs "is already synced" for every row on every sync tick #408

@khawarizmus

Description

@khawarizmus

Context: https://discord.com/channels/1138230179878154300/1495760178803507271

Summary

The attachment queue emits an info-level log line for every non-archived attachment on every periodic sync tick, including rows already in the synced state. With more than a handful of attachments, this becomes constant log spam that is hard to filter without silencing the whole PowerSync logger.

The JS SDK handles the same path silently. Aligning Dart with JS would fix the spam with no user-facing API change.

Where this happens

The periodic pipeline loads every non-archived attachment and hands them all to handleSync which then logs a line for every attachment, including synced and archived branches:

packages/powersync/lib/src/attachments/sync/syncing_service.dart#L118-L153

The periodic trigger itself also logs at info every tick:

syncing_service.dart#L79-L84

_periodicSubscription = Stream<void>.periodic(period, (_) {}).listen((_) {
  logger.info('Periodically syncing attachments');
  triggerSync();
});

How the JS SDK handles the same path

processAttachments only emits logs for actionable states; synced/archived rows fall through default: break silently:

packages/common/src/attachments/SyncingService.ts#L44-L67

The only info logs in JS are inside uploadAttachment / downloadAttachment; they fire only when actual work happens. No per-tick noise.

Proposed fix

Bring the Dart handleSync in line with the JS processAttachments:

  • Drop (or demote to Level.FINE) the logger.info('Processing attachment …') header inside the loop.

  • Drop the synced and archived logger.info(...) lines. Synced/archived rows should pass through silently, like JS.

  • Consider demoting the per-tick diagnostic lines (Periodically syncing attachments, Starting handleSync with N attachments, Found N active attachments) from info to fine/finer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions