Merge pull request #1142 from useautumn/patch/feat/get-entity-failopen

This commit is contained in:
amianthus
2026-03-31 19:13:41 +01:00
committed by GitHub
2 changed files with 26 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ from .types import (
SDKInitHook,
)
FAIL_OPEN_OPERATION_IDS = {"check", "track", "listPlans"}
FAIL_OPEN_OPERATION_IDS = {"check", "track", "listPlans", "getEntity"}
FAIL_OPEN_LOG_MESSAGE = (
"[Autumn] Request failed \u2014 failing open. "
@@ -35,6 +35,18 @@ FAIL_OPEN_BODIES: dict = {
"listPlans": {
"list": [],
},
"getEntity": {
"id": None,
"name": None,
"customer_id": None,
"feature_id": None,
"created_at": 0,
"env": "live",
"subscriptions": [],
"purchases": [],
"balances": {},
"flags": {},
},
}

View File

@@ -11,6 +11,7 @@ const FAIL_OPEN_OPERATION_IDS = new Set([
"check",
"track",
"getOrCreateCustomer",
"getEntity",
]);
const FAIL_OPEN_LOG_MESSAGE =
@@ -44,6 +45,18 @@ const FAIL_OPEN_BODIES: Record<string, object> = {
balances: {},
flags: {},
},
getEntity: {
id: null,
name: null,
customer_id: null,
feature_id: null,
created_at: 0,
env: "live",
subscriptions: [],
purchases: [],
balances: {},
flags: {},
},
};
export class FailOpenHook implements SDKInitHook, AfterErrorHook {