Skip to content

feat(sdk): capture SDK name + version (SIT-235 · core)#28

Merged
onamfc merged 1 commit into
mainfrom
brandon/sit-235-sdk-health-indicator-posthog-style-sdk-doctor
Jun 8, 2026
Merged

feat(sdk): capture SDK name + version (SIT-235 · core)#28
onamfc merged 1 commit into
mainfrom
brandon/sit-235-sdk-health-indicator-posthog-style-sdk-doctor

Conversation

@onamfc

@onamfc onamfc commented Jun 6, 2026

Copy link
Copy Markdown
Member

SDK Health + Doctor - core slice. Stacked on the SIT-237 core PR (#27); base will auto-retarget to main when #27 merges.

Persist which SDK (name + version) sent each install/event - the prerequisite for the SDK Health indicator + version Doctor.

  • in_app_events + install_events: nullable sdk_name / sdk_version (idempotent ALTERs). On both tables - an updated app keeps its original install row but emits events with the new version (needed for version-fragmentation diagnostics).
  • /api/sdk/v1/install + /event Zod schemas accept sdkName/sdkVersion; persisted via recordInstallEvent + the event insert(s). Backward compatible. 129 tests.

@onamfc onamfc force-pushed the brandon/sit-235-sdk-health-indicator-posthog-style-sdk-doctor branch from 39c7f1a to 87d4c13 Compare June 8, 2026 20:00
@onamfc onamfc changed the base branch from brandon/sit-237-auto-navigation-tracking-for-react-native-sdk to main June 8, 2026 20:00
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.63158% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib/database.ts 0.00% 27 Missing ⚠️

📢 Thoughts on this report? Let us know!

onamfc added a commit that referenced this pull request Jun 8, 2026
…handling

PR #28 review follow-ups:
- Add recordInstallEvent tests pinning sdk_name/sdk_version as the LAST two
  positional params of the 17-arg install_events INSERT (arrayContaining in the
  existing test doesn't catch positional drift), plus the empty/absent -> null case.
- Standardize the event-insert sdk values on `|| null` (was `?? null`) so an empty
  sdkName/sdkVersion stores null on both the install AND event rows, matching
  fingerprint.ts. No rejection — keeps free-form input.
- Comment the deliberate deferral of the sdk_version index to the consumer
  (SDK Doctor, cloud PR #118) so it matches the health-rollup query shape.
- Document the free-form sdkVersion contract on both SDK schemas (non-semver
  tolerated by the consumer; never reject a request over this metadata).
Persist sdkName/sdkVersion (sent by the SDKs) on install_events and
in_app_events for SDK version diagnostics. Backward compatible — older SDKs
omit the fields, which store null.

- /install and /event accept optional sdkName/sdkVersion (free-form, max 50;
  non-semver is tolerated downstream — never reject a request over this metadata).
- recordInstallEvent forwards them as the last two positional params of the
  install_events INSERT; tests pin those positions (guarding column drift) and
  cover the empty/absent -> null case.
- Empty values normalize to null consistently (|| null) on both rows.
- No index on sdk_name/sdk_version yet: deferred until a consumer aggregates
  them (e.g. "installs by version"), so the index can match the real query shape.
@onamfc onamfc force-pushed the brandon/sit-235-sdk-health-indicator-posthog-style-sdk-doctor branch from 250d6cb to 4628be3 Compare June 8, 2026 20:16
@onamfc onamfc marked this pull request as ready for review June 8, 2026 20:38
@onamfc onamfc merged commit c38f10f into main Jun 8, 2026
12 of 13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant