You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A failed allowance lookup during sync paywalls a paying user's conversation permanently #15232
A paying subscriber's conversation can be paywalled behind a 402 permanently, because the sync path treats "we could not work out your allowance" the same as "your allowance is used up".
backend/routers/sync.py decides the durable lock with:
should_lock=nothas_transcription_credits(uid)
has_transcription_credits returns resolve_transcription_allowance(uid, source).managed, and that resolver deliberately fails closed:
exceptExceptionasexc: # fail closed: a billed socket is never the defaultlogger.warning('transcription allowance unavailable for uid=%s: %s', uid, type(exc).__name__)
return_closed('allowance_unavailable')
It also returns _closed('usage_invalid') when the usage record cannot be trusted.
Failing closed is right for the listen WebSocket, where the alternative is opening a billed STT socket on an unknown entitlement. It is wrong here, because should_lock is written onto the stored conversation as is_locked, and is_locked produces a 402 on every later read:
ifconversation.get('is_locked', False):
raiseHTTPException(status_code=402, detail="A paid plan is required to access this conversation.")
Nothing routine clears it. unlock_all_conversations is called from three places, all of them subscription transition handlers in routers/payment.py, so a user whose plan does not change never triggers one.
So: an Unlimited subscriber syncs a recording, one Firestore call inside the allowance resolver times out during that request, the audio is still transcribed and the conversation is still created, but it is created locked. That conversation now returns 402 to its owner on every read, from the app, folders, search, MCP and the developer API, and stays that way.
The repo already distinguishes these cases for the other paid gate. resolve_conversation_processing_allowance returns allowed for both allowance_unavailable and usage_invalid, citing #12663. Only the durable sync lock collapses them into one boolean.
Proposing this as a paid bounty ($75) per the contribution docs, @kodjima33.
Activity
fix(sync): don't durably lock a conversation on a transient allowance…