Skip to content

Nutrition logbook becomes unusable when PowerSync user_ingredients fails with PSYNC_S2305 #1237

Description

@crp82

In a self-hosted WGER setup, the mobile app nutrition logbook becomes unusable when the PowerSync user_ingredients stream fails with PSYNC_S2305.

The underlying PowerSync issue has been reported here

The original WGER PowerSync rules are here

The relevant part is the user_ingredients stream, which is intended to synchronize only the ingredients referenced by the user.

Environment

  • WGER self-hosted Docker setup
  • PowerSync Service image: journeyapps/powersync-service:latest
  • PowerSync Service version label: 1.22.0
  • PowerSync image created: 2026-06-04T08:55:00.282316756Z
  • PowerSync revision label: 02d4ae6b61059248971748e85edf30e5be89edd1
  • Android client user agent from PowerSync logs: powersync-dart-core/2.3.0 Dart/3.12.2 android
  • App package tested: custom/debug build based on the WGER Flutter app

Observed data

For one affected user, the backend PostgreSQL database contains:

nutrition_logitem rows for the user: 1235
distinct ingredient_id values from nutrition_logitem: about 292
combined distinct ingredients from log items and meal items: 295

So the number of distinct ingredients is well below the documented 1000 parameter query result limit.

However, PowerSync raises PSYNC_S2305 for the user_ingredients stream and reports nutrition_logitem as exceeding the remaining parameter query result limit.

The relevant PowerSync log looked like this:

[PSYNC_S2305] Too many parameter query results (limit of 1000)

Invoked parameter queries by definition:
  Stream user_ingredients evaluating parameter on nutrition_nutritionplan: 1 results.
  ... and 1 more invocations
  Stream user_ingredients evaluating parameter on nutrition_logitem exceeded the remaining limit of 999 available results.

When this happens, the sync stream fails before sending data:

data_sent_bytes: 0
data_synced_bytes: 0
operations_synced: 0
close_reason: "stream error"

For more details please see my issue in the powersync repo here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions