fix: resolve three verified bugs from #1246#1247
Conversation
) Each was empirically reproduced AND independently confirmed (verify + adversarial refute). Three other suspected bugs were verified as NOT real — dead/unreachable code (executeChoice's getChoiceByName throws on miss), harmless redundancy (import cycle guard, proven via differential testing), and intended behavior (export asset-kind precedence) — and are left unchanged. - choiceService.duplicateChoice: the Multi branch skipped the excludeKeys copy the other choice types use, so duplicating a Multi dropped command/onePageInput — a Multi with a registered command lost it on the copy. Now copies all non-id/name/choices fields, then recursively duplicates children with fresh ids. - packages: isQuickAddPackage required schemaVersion === current exactly, which made parseQuickAddPackage's "newer than this plugin supports" message unreachable (a too-new package showed the generic "not a valid package" error). Relaxed the guard to a structural check (integer >= 1) and let parseQuickAddPackage own the version-range check; widened the schemaVersion field type to number. - quickAddApi.utility.getSelectedText: returned undefined on the no-view/no-selection branches while the sibling getSelection returns "", so getSelectedText() could be undefined and crash user scripts doing .toUpperCase(). Now returns "". Tests updated/added to lock in each fix. Closes #1246.
Deploying quickadd with
|
| Latest commit: |
941ec1a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fa8d2195.quickadd.pages.dev |
| Branch Preview URL: | https://fix-verified-bugs-1246.quickadd.pages.dev |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR updates three distinct behaviors: ChangesError handling, choice duplication, and schema version validation updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes the suspected bugs from #1246 that we empirically verified as real — each was reproduced AND survived an independent refutation pass. The other three were verified as not real and left unchanged.
Fixed (3, low severity)
choiceService.duplicateChoicedropped fields for Multi choices — the Multi branch skipped theexcludeKeyscopy the other types use, so duplicating a Multi lostcommand/onePageInput(a Multi with a registered Obsidian command lost it on copy). Now copies all non-id/name/choicesfields, then recursively duplicates children with fresh ids.isQuickAddPackagerequiredschemaVersion === currentexactly, so a too-new package failed with the generic "not a valid package" error andparseQuickAddPackage's specific "newer than this plugin supports" message never fired. Relaxed the guard to a structural check (integer >= 1);parseQuickAddPackagenow owns the version-range check. WidenedschemaVersiontonumber.quickAddApi.utility.getSelectedTextreturnedundefinedon no-view/no-selection while the siblinggetSelectionreturns""— sogetSelectedText().toUpperCase()could throw in user scripts. Now returns"".Verified NOT bugs (left unchanged)
executeChoice"proceeds with undefined choice" — theif (!choice)branch is unreachable:plugin.getChoiceByNamethrows on a miss and is typed: IChoice. (This was the one I'd flagged "medium" — the refutation pass caught that stage-1's reproduction assumed the wronggetChoiceByNamecontract.)Verification
bun run test(1400 pass),bun run build-with-lintclean,bun run check(svelte-check) clean. Each fix has a test asserting the corrected behavior.Summary by CodeRabbit
Bug Fixes
Improvements
command,onePageInput)