omi icon indicating copy to clipboard operation
omi copied to clipboard

app.omi.me/my-apps/new — Create App form silently fails, apps not saved

Open ekawough opened this issue 7 months ago • 2 comments

Bug: Create App form on app.omi.me does not save — silent failure

Portal: https://app.omi.me/my-apps/new

Account: [email protected] (Ethan.OmiDeveloper)

What happens

Filling out the Create App form completely (logo, name, description, category, External Integration capability, trigger, webhook URL, GitHub repo, Make Public toggled ON) and clicking Create App appears to succeed — the URL changes to /my-apps/{ULID} — but the app is never saved. Navigating to that ULID returns "Failed to load app details" and the app does not appear under My Apps.

This has happened consistently across multiple attempts and across multiple apps (tried: Deposition Digest, Field Report, Showing Notes, SalesSignal, SOAP Scribe).

Steps to reproduce

  1. Go to https://app.omi.me/my-apps/new
    1. Upload a logo image via the file input
    1. Fill in App Name, Description, select a Category
    1. Select External Integration capability
    1. Set Trigger to "Transcript Processed"
    1. Enter a valid webhook URL (e.g. https://myapp-production.up.railway.app/webhook)
    1. Enter a GitHub repo URL
    1. Toggle Make Public ON
    1. Click Create App

Expected

App is created and appears in My Apps list.

Actual

URL changes to /my-apps/{ULID} but page shows "Failed to load app details". App does not appear in My Apps. No error message shown during submission.

Notes

  • The old portal (h.omi.me/create-app) is no longer linked from the main site — app.omi.me appears to be the canonical developer portal now
    • Issue persists across browser sessions and multiple attempts
      • Tried with both canvas-injected images and directly uploaded PNG files

ekawough avatar Apr 27 '26 14:04 ekawough

Additional info: Omi user ID for the affected account: PX9VVe5qaYR9viuILXWJAx6ghV02

Also observed during investigation: multiple existing marketplace app detail endpoints returning 503 (e.g. /my-apps/01KFN6NR5GWDMQNKSFA6ZH8N38, /my-apps/01KGAFFKFPGJ46690FD981N05F) — suggesting a broader backend availability issue, not isolated to new app creation.

ekawough avatar Apr 27 '26 14:04 ekawough

Root cause

POST /v1/apps (backend/routers/apps.py:463-540) never assigns data['uid'] = uid server-side. The handler resolves uid from the bearer token via Depends(auth.get_current_user_uid) but only uses it to look up author/email and build a payment link — it never writes it into the dict passed to add_app_to_db.

AppCreate.uid is Optional[str] = None (backend/models/app.py:235), so validation passes when the field is missing and model_dump(exclude_unset=True) drops it. The Firestore document lands with no uid.

Retrieval (get_app_details, line 846) then 404s on:

if not app.approved and app.uid != uid:
    raise HTTPException(status_code=404, detail='App not found')

Newly created apps are approved = False (line 466) and have no uid, so the check fails and every fresh app 404s for its own creator. List endpoints filter by uid too, so it also disappears from "My Apps". The POST returns {"status": "ok", "app_id": ...}, so the frontend redirects to /my-apps/{id} and only the GET fails — hence the silent feel.

Why it slipped through

The Flutter client populates uid client-side before POSTing, masking the server gap (e.g. app/lib/pages/apps/providers/add_app_provider.dart:519):

final appData = { ..., 'uid': SharedPreferencesUtil().uid, ... };

So json.loads(app_data) lands with data['uid'] already set and the model keeps it. The web portal (web/app/src/lib/api.ts:createApp) correctly sends only the bearer token in Authorization and does not echo uid into the body, which exposes the latent bug — the backend has been trusting the client to supply identity.

Confirmed in production logs

Cloud Run backend logs on the report date show the create→404 pattern from the web portal (node user-agent), every POST followed within ~1 s by a 404 GET on the just-returned id. Dart-UA POSTs in the same window do not auto-GET the detail page, which is why the bug hadn't surfaced from mobile.

Fix

One line in create_app, mirroring create_persona at line 553:

data['id'] = str(ULID())
data['uid'] = uid          # make server authoritative for identity

This makes the mobile client's pre-set uid a no-op and removes the client-trust footgun. Already-created orphan documents from the web flow need a one-off backfill writing uid from email, otherwise they stay unreachable.

mdmohsin7 avatar May 02 '26 16:05 mdmohsin7