Conversation
PaperBell 0.4.7 invalidates any PPBClient handle from a previous host load: every request* on it resolves to null and its config push is gone. Our ready listener guarded on `!this.client`, so once the host updated we kept holding that dead handle — language following and account status silently stopped working until the user disabled and re-enabled this plugin by hand. attach() now runs on every paperbell:ready, not just the first: it releases the old handle, registers again, re-reads capabilities and re-subscribes. The last known config survives a reconnect (and a failed re-register), so the UI never flips back to the fallback language; on a reconnect only, we refetch the config when listGrants() says the scope is already granted, which prompts for nothing. A first connect stays scope-free by design. Also re-vendors the contract against 0.4.7: PPB_SCHEMA_VERSION 1 -> 2, so the "host schema is newer than vendored" warning stops firing spuriously, with type names aligned to the host's published contract appendix. Nothing else in the migration applies to us: we never reached past `.api` into the host's internals, never read plugin.settings, and no feature builds a URL from llm.baseUrl yet. Our settings card in PaperBell now appears only once a scope is granted — accepted deliberately, documented under "Deferred consent". Refs: MIGRATION-0.4.7.md in PaperBell-Org/Obsidian-PaperBell-Plugin Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Follow-up to the PaperBell main plugin's MIGRATION-0.4.7.md.
The bug this fixes
0.4.7 invalidates any
PPBClienthandle from a previous host load: everyrequest*on it resolves tonulland its config push is gone. Our ready listener guarded on!this.client, so once PaperBell updated we kept holding that dead handle — language following and account status silently stopped working until the user disabled and re-enabled this plugin by hand.attach()now runs on everypaperbell:ready: it releases the old handle (unsubscribe + unregister, both wrapped), registers again, re-reads capabilities, and re-subscribes. Two details keep the recovery invisible:listGrants()saysconfigis already granted — the grant outlived the reload, so this prompts for nothing. A first connect stays scope-free by design.There is deliberately no "same host object, skip the handshake" shortcut: whether a reloaded host hands back a fresh
apiis its business, and guessing wrong would leave us on a dead handle forever.Contract re-vendored to 0.4.7
PPB_SCHEMA_VERSION1 → 2, so the "host schema is newer than vendored" console warning stops firing spuriously for every user who has PaperBell installed. Type names now match the host's published contract appendix verbatim (PaperBellRestrictedConfig+ deprecated alias,PaperBellLLMCredentials,PaperBellActivationInfo,PPBProtectedDownload*), plus the optionalprofile/cimpoFolders/ completion-quota fields 0.4.7 added. The proposedprojectsscope stays marked as ours, not upstream's.The rest of the migration
api+settingsremain on the plugin instance.apisettings;pluginGrantsno longer forgeablellm.baseUrl/llm.modelare now effective valuesTests
MockPaperBellHost.reload()models a 0.4.7 zombie handle (everyrequest*→null, subscribers dropped) so a test can't pass against a dead handle. Nine new tests cover re-registration, re-subscription, config retention (including the failed-re-register path), the grant-gated refetch, a scope-free first connect, and the "never two live registrations" invariant.npm run lintclean; 447 tests pass.