Skip to content

fix(profile): propagate billing_enabled + paypal client_id/env to the frontend#102

Open
ClaydeCode wants to merge 1 commit into
mainfrom
fix-profile-billing-fields
Open

fix(profile): propagate billing_enabled + paypal client_id/env to the frontend#102
ClaydeCode wants to merge 1 commit into
mainfrom
fix-profile-billing-fields

Conversation

@ClaydeCode
Copy link
Copy Markdown
Contributor

Symptom

After deploying the in-window PayPal flow, the web-terminal subscription section doesn't render at all — even for a shard with an active subscription. The profile the frontend receives has no billing_enabled / paypal_client_id / paypal_environment, so the gate v-if billing_enabled is undefined → section hidden.

Cause

shard_core drops the new self-view fields in two places:

  1. refresh_profile does ShardResponse.model_validate(controller_json) against shard_core's copied ShardResponse (which lacked the three fields → pydantic strips them on parse).
  2. The hand-written Profile model + from_shard (a bespoke remap, not auto-synced) also lacked them.

So even though controller#286 returns the fields, they never reach the web-terminal. (Same stripping class as the earlier subscription-summary fix, compounded by Profile being hand-mapped.)

Fix

  • just get-types: shard_core's ShardResponse copy gains billing_enabled / paypal_client_id / paypal_environment (also reconciles subscription_model).
  • Profile model + from_shard: carry the three fields, getattr-guarded with safe defaults.
  • Tests: from_shard carries the fields when set; defaults to disabled when absent.

Release impact

core v13 must bump the shard_core image too (not just web-terminal) — this is the shard_core change that was missed. Sequence: cut shard_core release → v13 bundles new shard_core + new web-terminal → controller release → deploy → re-upgrade the trial shard.

Recommended reading order

  1. shard_core/data_model/profile.py — Profile model + from_shard mapping
  2. shard_core/data_model/backend/shard_model.py — get-types'd ShardResponse fields
  3. tests/test_profile.py — propagation + default tests

Tracks #265.

🤖 Generated with Claude Code

… the frontend

The controller self-view now returns billing_enabled / paypal_client_id /
paypal_environment, but shard_core dropped them: refresh_profile parses the
response into shard_core's ShardResponse copy (which lacked the fields) and
re-maps a subset into the hand-written Profile model (which also lacked them).
Result: the web-terminal never received billing_enabled, so the subscription
section stayed hidden even for subscribed shards.

- get-types: ShardResponse copy gains the three fields (+ subscription_model sync).
- Profile model + from_shard: carry billing_enabled / paypal_client_id /
  paypal_environment (getattr-guarded, safe defaults).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant