fix(plugins): keep ui_extensions driver filter when parsing plugin manifests#424
Merged
Conversation
…nifests UIExtensionEntry was missing the driver field, so serde silently dropped it while deserializing plugin manifests. The frontend then received entries without a driver filter and rendered every connection_content contribution for every driver, letting plugins overwrite each other's connection state in the new-connection modal.
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.
Problem
When two plugins both contribute to the
connection-modal.connection_contentslot, their UI renders at the same time regardless of which driver is selected. Worse, since custom connection fields are encoded into the shareddatabasevalue, one plugin ends up overwriting the other's connection state as soon as the modal mounts (e.g. the WordPress fields showing up — and injecting their config — under a Google Sheets connection).Cause
Plugin manifests can already scope a UI extension to a driver:
{ "slot": "connection-modal.connection_content", "module": "ui/dist/index.js", "driver": "wordpress" }and the frontend honors it via the
whenpredicate inPluginSlotProvider. ButUIExtensionEntryon the Rust side only declaredslot,moduleandorder, so serde silently droppeddriverwhile deserializing the manifest. By the time the entries reached the frontend the filter was gone, and every contribution rendered for every driver.Fix
Add the missing
driver: Option<String>field toUIExtensionEntryso the filter survives the manifest round-trip. No frontend changes needed — the whole chain (manifest.json→get_plugin_manifest→whenpredicate) already supported it.Also adds a regression test covering manifests with and without the
driverfield.Testing
cargo test --lib plugins::tests— 3 passeddriverfilter in their manifests, so no plugin changes are needed.