Skip to content

fix(sync): enforce the fair-use ceiling and plan-aware caps in V2 #10002

Description

@Git-on-my-level

PR #9964 states that its hard daily-audio ceiling is enforced for fresh Sync and that plan-aware soft caps protect paid unlimited tiers. On current main, is_daily_audio_ceiling_exceeded is imported and called only by the V1 route (backend/routers/sync.py:579); POST /v2/sync-local-files has no equivalent pre-admission check. Its worker also calls check_soft_caps(uid, speech_totals=...) without the subscription plan (backend/utils/sync/pipeline.py:1789-1790), unlike V1. This leaves the primary asynchronous Sync path outside the intended anti-abuse ceiling and applies default caps to unlimited users. Repair production behavior with regression coverage; do not simulate either policy only inside a hermetic test harness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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