fix(importer)!: leave the devMode default to OneSchema - #197
fix(importer)!: leave the devMode default to OneSchema#197behnam-oneschema wants to merge 1 commit into
Conversation
An unset devMode no longer sends dev_mode to the embed, so the backend's own default applies instead of an SDK-side false. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 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:
|
|
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 (6)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe importer no longer defaults ChangesdevMode behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The SDK now omits devMode when the host leaves it unset while preserving explicit true or false values; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (3 skipped: 3 unsupported.) Full details: Security CheckExplanation No security concern is introduced by this PR. The change only removes the SDK default ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Bundle size report
|
Browser E2E against staging:
|
Summary
0.8 replaced
devMode'sprocess.env.NODE_ENVguess with an SDK-sidefalse(#196). Per discussion, the default should not live in the SDK at all:dev_modeis a server-side concept — it is persisted on theEmbedrecord, folded into the embed-init dedup launch key, sent toAnalytics.identify, and drives whether the embed renders diagnostics or end-user error copy — so OneSchema owns its default and the SDK only reports an explicit host choice.DEFAULT_PARAMS = { - devMode: false, } -queryParams.push(`dev_mode=${this.#params.devMode}`) +if (this.#params.devMode !== undefined) { + queryParams.push(`dev_mode=${this.#params.devMode}`) +}devModestaysboolean | undefinedin the public type, so nothing changes for a host that passes it:devMode: falsestill sendsdev_mode=false, distinguishable from unset. Unset now omits the param entirely, and the embed'surlParams.get("dev_mode") === "true"plus rubeos'cleaned[:dev_mode] || falsesupply the default — the same effective behavior as before for every host that did not set it, but decided in one place.The SDK's own
devModeuses (showing a failed launch's iframe instead of honoringautoClose) treat unset as off, unchanged.Test plan
yarn workspace @oneschema/importer test:ci— 36/36, including a new case asserting the embed URL carries nodev_modewhen unset anddev_mode=true/dev_mode=falsewhen set explicitly.yarn build,yarn docs:api(regenerated the core README option table),yarn fix,yarn check— clean apart from the pre-existingfilefeeds-reactsaveSessionhook warning onmain.Link to Devin session: https://app.devin.ai/sessions/0f6a86671bae4388870cb4d122431d2b
Open in Devin Desktop: https://app.devin.ai/desktop/session/0f6a86671bae4388870cb4d122431d2b?variant=devin
Requested by: @behnam-oneschema