fix(profile): propagate billing_enabled + paypal client_id/env to the frontend#102
Open
ClaydeCode wants to merge 1 commit into
Open
fix(profile): propagate billing_enabled + paypal client_id/env to the frontend#102ClaydeCode wants to merge 1 commit into
ClaydeCode wants to merge 1 commit into
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 gatev-if billing_enabledis undefined → section hidden.Cause
shard_core drops the new self-view fields in two places:
refresh_profiledoesShardResponse.model_validate(controller_json)against shard_core's copiedShardResponse(which lacked the three fields → pydantic strips them on parse).Profilemodel +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
Profilebeing hand-mapped.)Fix
just get-types: shard_core'sShardResponsecopy gainsbilling_enabled/paypal_client_id/paypal_environment(also reconcilessubscription_model).Profilemodel +from_shard: carry the three fields,getattr-guarded with safe defaults.from_shardcarries 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
shard_core/data_model/profile.py— Profile model + from_shard mappingshard_core/data_model/backend/shard_model.py— get-types'd ShardResponse fieldstests/test_profile.py— propagation + default testsTracks #265.
🤖 Generated with Claude Code