Skip to content

A failed allowance lookup during sync paywalls a paying user's conversation permanently #15232

Closed

Description

@singhharsh1708

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 = not has_transcription_credits(uid)

has_transcription_credits returns resolve_transcription_allowance(uid, source).managed, and that resolver deliberately fails closed:

    except Exception as exc:  # fail closed: a billed socket is never the default
        logger.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:

    if conversation.get('is_locked', False):
        raise HTTPException(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

  1. moved this from Someday to In progress in omi TODO / bountieson Sep 20, 2026
  2. moved this from In progress to In review in omi TODO / bountieson Sep 22, 2026
  3. added a commit that references this issue on Sep 22, 2026
    9657214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions