Skip to content

fix: protect mobile LoadPlugins call's context - #259

Merged
tjjh89017 merged 2 commits into
mainfrom
fix/mobile-loadplugins-context
Jul 29, 2026
Merged

fix: protect mobile LoadPlugins call's context#259
tjjh89017 merged 2 commits into
mainfrom
fix/mobile-loadplugins-context

Conversation

@tjjh89017

Copy link
Copy Markdown
Owner

Summary

  • mobile/controller.go's cycle() now wraps the context passed to manager.LoadPlugins(...) with protectedContext(ctx, c.node.protector), matching the existing pattern already used by publish()/establish() for their store-access contexts.
  • Corrected the adjacent comment: plugin factories (registry.Factory) don't currently thread ctx through, so this protects the LoadPlugins call boundary only -- Store.Get/Set (via publish/establish's storeCtx) remain the actual protected network path for plugins today.

Closes #254

Test plan

  • make mobile-test passes
  • golangci-lint (mobile tags) clean
  • CI green on this PR

#251 added script-level smoke tests for the contrib plugins but they
were never invoked by any Makefile target or GitHub workflow, only
guarding regressions when run manually.

Add plugin-test/contrib-test targets (root Makefile -> contrib/Makefile
-> per-plugin Makefiles) that run each plugin's smoke_test.sh or go
test, wire a new contrib-test CI job into main.yml, and document the
smoke tests in contrib/README.md and CLAUDE.md.

Signed-off-by: Date Huang <tjjh89017@hotmail.com>
mobile/controller.go's cycle() called manager.LoadPlugins(ctx, ...)
with the bare ctx, while publish()/establish() already wrap their
contexts via protectedContext() before touching plugin store paths.
Wrap LoadPlugins' context the same way for consistency, and correct
the adjacent comment: plugin factories (registry.Factory) don't
currently thread ctx through, so this protects the LoadPlugins call
boundary only -- Store.Get/Set (via publish/establish's storeCtx)
remain the actual protected network path for plugins today.

Signed-off-by: Date Huang <tjjh89017@hotmail.com>
@tjjh89017
tjjh89017 merged commit 21bf49d into main Jul 29, 2026
60 checks passed
@tjjh89017
tjjh89017 deleted the fix/mobile-loadplugins-context branch July 29, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mobile: LoadPlugins runs with an unprotected context

1 participant