Repository navigation
feat(importer): send the core importer version in init messages - #187
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
Limit details: You’ve used the included review currently available. Your 109 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe importer now includes its core package version in outbound iframe initialization messages. Tests verify this metadata separately from wrapper-specific values. Importer CI scripts now run the Node test suite, and a changeset records patch releases. ChangesImporter core version metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR adds the core importer version to iframe initialization messages while preserving wrapper identity fields and adds focused regression coverage; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (2 skipped: 2 unsupported.) Full details: Security CheckExplanation No new security concern is introduced. The PR adds only the static package version to messages that already contain client/version metadata and credentials. The existing
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Bundle size report
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
test: ci was a no-op, so the new core-version regression test would never have run on a pull request. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ebcad0f to
b350169
Compare
Summary
Every message the importer posts into the embed iframe is stamped by
#iframeEventEmitwithversion/client/@from, andsetClient(client, version)overwrites both#clientand#version. So for@oneschema/react,@oneschema/vueand@oneschema/angularthe core importer version never reaches the app — the wrapper version takes its place, and server-side telemetry has no way to tell which core protocol actually ran a session.That distinction is not cosmetic: React and Vue inline a core build, while
@oneschema/angulartakes@oneschema/importeras a peer, so@oneschema/angular@0.7.5paired with core0.6.1for anyone who installed before #177 — a wrapper version simply does not imply a core version.The fix is one immutable field and one line on the wire:
Deliberately not in
launch()'sbaseMessageorOneSchemaSharedInitParams: stamping it in the single place that already stamps identity meanscoreVersioncannot drift from the bundle it was built into, and no wrapper package needs to change (or can get it wrong).@fromis left alone so existing log/debug parsing keeps working.The consumer is oneschema/oneschema#20562, which reads
coreVersionoff theinit/init-sessionmessage and records it assdk_core_versiononsdk_sessions_total. It ships first and treats the field as optional, so ordering is safe either way; until this is published, every session reportssdk_core_version="unknown".Two incidental notes:
packages/importer'stest:ciwas"true", i.e. CI ran no importer tests. The new regression test would never have run on a PR, sotest:cinow actually invokes it (second commit). It isnode --testagainst the builtdist/main.jswith a minimalwindow/iframe stub, matching the fact that the package has no unit-test harness today;test:unitbuilds first for local runs, whiletest:cirelies on CI's existing build step.Test plan
The test that matters is the wrapper case —
setClient("React", "0.7.4")must changeversionand@fromwhile leavingcoreVersionat the core package version:Built bundles now send
coreVersion: "0.7.5".Not exercised locally: an end-to-end wrapper session against a live embed app. The wrapper packages are untouched and the assertion above covers the only path that could regress, but the full-service confirmation will come from the SDK matrix in oneschema/oneschema once this is published.
Link to Devin session: https://app.devin.ai/sessions/bf7327c4513c45c0b0845edeb7aad2d9
Open in Devin Desktop: https://app.devin.ai/desktop/session/bf7327c4513c45c0b0845edeb7aad2d9?variant=devin
Requested by: @behnam-oneschema