fix: remove Bearer auth header for Supabase publishable key (telemetry broken since 0.5.5)

Supabase migrated from JWT anon keys to sb_publishable_ keys in 2025.
The new keys are not JWTs and cannot be sent as Bearer tokens in the
Authorization header. The apikey header alone is sufficient for
PostgREST operations. This was silently failing (swallowed exception)
since the key migration, causing zero telemetry for all versions > 0.5.5.
This commit is contained in:
chopratejas 2026-03-27 20:43:53 -07:00
parent 80bfb04ddd
commit 854d9f3de5

View file

@ -252,7 +252,8 @@ class TelemetryBeacon:
json=payload,
headers={
"apikey": _SUPABASE_KEY,
"Authorization": f"Bearer {_SUPABASE_KEY}",
# sb_publishable_ keys are not JWTs — don't send as Bearer token
# (Supabase migrated from JWT anon keys to publishable keys in 2025)
"Content-Type": "application/json",
# Upsert: on conflict with session_id, merge (overwrite) the row
"Prefer": "resolution=merge-duplicates,return=minimal",