Skip to content

Commit 6b9646c

Browse files
release: subscription_active boolean parse fix (#28)
* docs(how-to): add preview_mode + Smart Notebook canonical example (#20) - Documents preview_mode behavior (banner, disabled buttons, "Preview" label) and when to use it - Points the recipe at the Smart Notebook seeder as the canonical reference implementation — every field exercised, real numbers - Bumps scaffold manifest to 2026.05.05 so installer picks up the updated how-to Pairs with fl-api PR #67 + fl-elon-web-ui PR #70. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * feat(opportunities): wire crowdfunding + preview_mode fields through CLI (1.3.26) (#21) The May 3 push/pull/diff/create commands silently dropped every crowdfunding field — funding_goal_cents, equity_pool_bps, roles[], pitch_sections[], plus the new preview_mode boolean. Round-tripping JSON appeared to work but never persisted any of the new fields. Fixes: - push: forwards funding_goal_cents/equity_pool_bps/roles/pitch_sections/preview_mode/is_public - diff: compares those fields plus correct skills_required key - create: --funding-goal (dollars), --equity-pool-pct, --roles-file, --pitch-file, --preview - new `iris opportunities preview <id>` command — toggles preview_mode with optional --on/--off flags; without flags it auto-detects current state and flips it How-to recipe documents the CLI-only flow + manifest bumped to 2026.05.06 so installer picks up the new docs. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * chore: bump to 1.3.27 (1.3.26 already used by sync-comms release) * feat(opportunities): link-lead command + lead_id passthrough (1.3.28) (#24) - New `iris opportunities link-lead <oppId> <leadId>` command — sets opportunity.lead_id with one call. Pass `0` to unlink. - push: forwards lead_id from local JSON - diff: includes lead_id in compared fields Pairs with fl-api PR #69 which exposes lead_id on the opportunity update endpoint + public payload. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * fix(install): parse subscription_active boolean directly (jq // bug) (#27) The smart paywall block in PR #16 used json_field() to extract subscription_active from the cli/auth/me response, but json_field's jq path uses `(.field // .data.field) // empty` — and jq's `//` operator treats both `null` AND `false` as "missing", so when the API returns subscription_active=false, json_field returns an empty string instead of "false". Result: the gate's outer if/elif both fail to match, so no Stripe popup AND no "active subscription" message — install just exits silently after Hive registration. The user has identity but no paywall enforcement and no signal that anything's wrong. Confirmed by founder smoke test: [email protected] (sub_active=false in cli/auth/me) ran the installer, got "Authenticated! / Hive registered / Ready to go!" with no paywall step in between. Fix: extract subscription_active directly via `jq -r '.subscription_active'` which prints the literal "true"/"false" string. Same fallback chain as json_field (jq → python3 → sed-grep) so no platform regressions. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 4dbd964 commit 6b9646c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎install‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2295,7 +2295,16 @@ if [ "$AUTH_SUCCESS" = "true" ] && [ -n "$SDK_TOKEN" ] && [ "$tty_available" = "
22952295

22962296
SUB_ACTIVE="unknown"
22972297
if [ "$SUB_STATUS" = "200" ]; then
2298-
SUB_ACTIVE=$(json_field "$SUB_BODY" "subscription_active")
2298+
# subscription_active is a JSON boolean. Don't use json_field — its jq
2299+
# path uses `// empty` which treats `false` as missing and returns "".
2300+
# Extract directly so we get the literal "true"/"false" string.
2301+
if command -v jq >/dev/null 2>&1; then
2302+
SUB_ACTIVE=$(echo "$SUB_BODY" | jq -r '.subscription_active' 2>/dev/null)
2303+
elif command -v python3 >/dev/null 2>&1; then
2304+
SUB_ACTIVE=$(echo "$SUB_BODY" | python3 -c 'import sys,json;print(str(json.load(sys.stdin).get("subscription_active","unknown")).lower())' 2>/dev/null)
2305+
else
2306+
SUB_ACTIVE=$(echo "$SUB_BODY" | grep -oE '"subscription_active"[[:space:]]*:[[:space:]]*(true|false)' | grep -oE 'true|false' | head -1)
2307+
fi
22992308
fi
23002309

23012310
# Only paywall if we got a definitive "no". Network errors / unknown state

0 commit comments

Comments
 (0)