feat(subscribers): pin, replace, and clear a subscriber location - #26
Merged
Conversation
Closes #24. The spec added three endpoints for a subscriber's pinned location. kit subscribers location pin <id> --city --state-province --country-code \ --latitude --longitude --time-zone kit subscribers location update <id> # same six flags, all required kit subscribers location delete <id> Kit infers a location from open events. Pinning overrides that. PATCH is a full replacement rather than a merge, so update takes the same six required flags as pin. A test asserts the two commands require an identical set, so they cannot drift apart. There is no get. Location comes back through include=location on list and filter. ## Client additions patch() joins get, post, put, and del. request() already handled the verb. Three validators, all with the same job: turn a 422 into a clear CLI error. - validateFloatInRange, for coordinates, where zero and negatives are valid. - validateCountryCode, two letters, upper-cased on the way out. - validateTimeZone, checked against the IANA list that Intl already carries. The time zone check needed care. Intl on its own accepts a UTC offset like -07:00 and an abbreviation like PST, and neither is an IANA name. An offset also ignores daylight saving, which is the reason to send a zone at all. So it checks Intl.supportedValuesOf, allows UTC, GMT, and the Etc/* family that the list omits, and returns the canonical spelling. So america/denver becomes America/Denver. ## The pipeline gap that hid this The spec-check workflow used a skip-ci directive, so it pushed a spec that broke the suite and no CI run ever reported it. main sat red at 496/497 and only showed up when this branch failed locally. Dropping that directive closes the gap. A spec change now fails Tests on main immediately, which is the point of the coverage map. Coverage: 76 operations, all mapped. Surface: 107 commands. Tests: 497 before, 560 after. Note on this very message: GitHub honors a skip-ci directive anywhere in a commit message, so naming it literally here would have skipped this commit's own CI run. It did, on the first attempt.
imjohnbo
force-pushed
the
fix/subscriber-location
branch
from
August 24, 2026 18:45
5ea38e0 to
c5d0a61
Compare
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.
Closes #24, and fixes the pipeline gap that let it break
mainunnoticed.The three endpoints
Kit infers a subscriber's location from open events. Pinning overrides that.
PATCHis a full replacement rather than a merge, soupdatetakes the same sixrequired flags as
pin. A test asserts the two require an identical set, so theycannot drift apart.
There is no
get. Location comes back throughinclude=locationon list andfilter, which the CLI already supports.
Client additions
patch()joinsget,post,put, anddel.request()already handled theverb.
Three validators, all with one job: turn a 422 into a clear CLI error.
validateFloatInRangevalidateCountryCodeUSAandUnited States. Upper-cases on the way out.validateTimeZoneThe time zone check needed more care than expected.
Intlon its own accepts aUTC offset like
-07:00and an abbreviation likePST, and neither is an IANAname:
An offset also ignores daylight saving, which is the reason to send a zone at
all. So the validator checks
Intl.supportedValuesOf('timeZone'), allowsUTC,GMT, and theEtc/*family that the list omits, and returns the canonicalspelling.
america/denverbecomesAmerica/Denver.The pipeline gap
mainwas red at 496/497 and no CI run said so.The spec-check workflow commits with
[skip ci]. It pushedbd00f6f, a new speccarrying these three endpoints, and
scripts/spec-coverage.test.jsbegan failingby design. Because of
[skip ci], the Tests workflow never ran on that commit.The only reason this surfaced at all is that a later branch failed locally.
This PR removes
[skip ci]. A spec change now fails Tests onmainimmediately, which is what the coverage map is for. The comment in the workflow
records why, so nobody adds it back.
Review notes
Coverage: 76 operations, all mapped, no gaps.
Surface: 107 commands, snapshot regenerated.
Tests: 497 before, 560 after.
The semver gate reports the surface change as skipped, correctly. There is no
v0.0.1tag yet, so there is no baseline to compare against. Once a releaseexists, adding commands like these would require a minor bump.