mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
require_personinsights_client() raises RuntimeError when no client is configured, and the rest of the file states the rule for it: it "must run inside personinsights_call so a missing client (RuntimeError) is wrapped as DatabaseError and recovered like any fetch failure". One site called it a line early, outside the wrapper, so the RuntimeError never became a DatabaseError and walked straight past the `except DatabaseError` written to recover from exactly this. It reached the request as a 500. Moved inside the lambda, where the rule says it belongs. Then the recovery itself: an absent client is not a fetch failure, it is a deployment that does not run personinsights, and the group types are still in Postgres. Treating it as a failure sent both readers down the stale-cache path, which raises GroupTypesUnavailable for any project with no cached entry — so a fresh project answered 500 permanently rather than once. Both now read the table when there is no client. The proto converter is documented as producing "the same dict shape as GroupTypeMapping.objects.values(*GROUP_TYPE_MAPPING_SERIALIZER_FIELDS)", so that is the shape, read from the source it was matching. Also: the debrand rules never matched all-caps HEDGEHOG, so four sites survived every convergence run, and HOG_ ran first and rewrote HEDGEHOG_MODE to HEDGEINSIGHTS_MODE — the same class of collision the tool already documents for POSTHOG_. The rule is added above HOG_ so it cannot re-mint them. Not fixed here, and customer-visible: frontend/public/insights-logo.png is the upstream wordmark verbatim and renders as the header of every outbound email, and invite-email-welcome.png carries the mascot into every team invite. Four more assets (insights-logo.svg, insights-icon.svg, plan_teams.png, early-access-feature-demo.png) are upstream artwork too. Binary assets are in SKIP_CONTENT_SUFFIX, so the gate cannot see any of them.