Repository navigation
Observe the account's billing arrangement - #90
Conversation
observeRoot() already reads four fields off the account root. Mailchimp answers pricing_plan_type on that same response and it was not read. It separates an account that pays for a plan from one that pays nothing, which is not derivable from anything else on the response. Three values are known in the field -- monthly, forever_free, pay_as_you_go -- and it is kept as the string the API gave rather than mapped to an enum, so a value we have not seen arrives intact instead of collapsing into whatever our default happened to be. Bounded at 32 characters, as the other string fields here are. NOT the plan tier. Nothing on this response distinguishes Essentials from Standard from Premium, and the docblock says so, because a reader who assumes otherwise would draw a conclusion the data cannot support. Passive: no new call, no quota, nothing added to any request. Emitted below the lean cut, alongside the other fields that identify or explain.
|
The code is right and I have nothing to change in it.
The key nameUse The precedent on this lane is The tag is not blocked on youNothing consumes either spelling yet. That side is ours and it has not been built — so the silent outcome you are describing is real, but it is ours to fix and not a reason to hold your tag. Name it One thing in the description, before this is taggedNot the code — the pull request description. The verification block prints a live account identifier, an address and a contact figure, and the closing section describes behaviour on our side of the wire. Neither belongs in a public repository. A description is editable, which several things here are not, so this is cheap to fix now and expensive later. Could you take both out? Happy to keep the same shape — the choices you set out are worth having in public, it is only those two pieces that are not. I will send you the specifics separately rather than repeat them here. |
Raised in review. The envelope key is pricing_plan_type rather than plan_type, matching the spelling on the response it is read from -- the same rule total_subscribers follows on that same response. Short spellings on this lane are reserved for the high-frequency per-beacon fields, where the saving is real. An account-root attribute read once per process belongs with the long-form group, and matching the upstream name means nobody holds a translation in their head.
dipola
left a comment
There was a problem hiding this comment.
Approved. pricing_plan_type at all three sites and the 32-character bound intact — this matches the wire exactly, and the receiver now has somewhere to put it.
The docblock ruling out the tier reading is the part that will still be earning its keep in a year.
Part 1 of the library-side telemetry ask. Three lines of code and rather more comment.
observeRoot()already readsaccount_id,total_subscribers,account_nameandemailoff the account root.pricing_plan_typeis on that same response and was not read.Verified against a live account rather than taken from the issue:
pricing_plan_typeis present on thesame response as the four fields
observeRoot()already reads, and answered with one of the documentedvalues.
Choices worth stating
Kept as the string the API gave, not mapped to an enum. Three values are known in the field —
monthly,forever_free,pay_as_you_go— but a fourth would collapse into whatever a default happened to be, and silently. Bounded at 32 characters like the other string fields here.First-non-empty wins, matching
account_idand the owner pair rather thantotal_subscribers, which overwrites. The billing arrangement is an attribute of the account a bucket is already attributed to, so it should not move under a report mid-process.It is not the plan tier, and the docblock says so at length. Nothing on this response distinguishes Essentials from Standard from Premium. A reader who assumes otherwise would draw a conclusion the data cannot support, and that is exactly the kind of assumption a comment should stop rather than leave to be discovered.
Passive: no new call, no quota, nothing added to any request.
Verified
tools/no-deprecated-calls.php: 64 files, 0 findings.Key name
Emitted as
pricing_plan_type, matching Mailchimp's own spelling on the response it is read from — thesame rule
total_subscribersfollows. Long form rather than abbreviated, because this is read once perprocess rather than per call, so there is no saving to trade a translation step for.