Fix quickstart consumer smoke negative control to test missing Targeting Key - #608
Merged
Merged
Conversation
Keep the stale quickstart snippet syntactically valid when stripping targetingKey, and require TypeScript to report that required property instead of treating any typecheck failure as a pass. Issue: SPL-626 Co-authored-by: Isaac Suttell <isaac@zaks.io>
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Summary
The packed SDK consumer smoke treated any TypeScript failure as proof that omitting
targetingKeyis rejected. The stale-snippet transform left a dangling comma (evaluate(..., {, })), so the negative control could pass for a syntax error instead of the required Targeting Key contract.Changes
stripTargetingKeyFromSnippetnow removestargetingKey: userIdwithout leaving a dangling comma, and leaves optional neighbors such asidempotencyKeyintact.targetingKeyis missing. Object-literal syntax errors and a successful typecheck (optional Targeting Key) fail the guard.evaluateandevaluateDetailscall shapes, syntax validity, and the optional-targetingKeymutation.Risk: LOW
Test plan
node --test packages/sdk/scripts/extract-quickstart-snippet.test.mjspnpm --filter @splitch/sdk test(306 vitest + 19 node:test passed)pnpm --filter @splitch/sdk typecheckpnpm --filter @splitch/sdk test:consumer-smoke(positive packed smoke + stale targetingKey guard)pnpm verify:pushIssue: SPL-626
Linear Issue: SPL-626
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.