fix(matrix): add idempotency guard to prevent duplicate registration (fixes #52780)#3
Open
fix(matrix): add idempotency guard to prevent duplicate registration (fixes #52780)#3
Conversation
Signed-off-by: sallyom <somalley@redhat.com>
…cy across components (openclaw#53238)
…anks @BunsDev Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com> Co-authored-by: Nova <nova@openknot.ai>
…ntrol-char injection - Use hasOwnProperty + isBlockedObjectKey in isConfiguredAuthPlugin to prevent __proto__/constructor/prototype keys from matching config - Sanitize plugin IDs with sanitizeForLog in ambiguity error messages - Add regression test for __proto__ plugin ID
OPENCLAW_PLUGIN_API_VERSION was hardcoded to "1.2.0" while ClawHub-published plugins require >=2026.3.22, making all plugin installs via ClawHub fail with "requires plugin API >=2026.3.22, but this OpenClaw runtime exposes 1.2.0". Use resolveRuntimeServiceVersion() (already imported) to read the actual version from package.json at runtime. Fixes openclaw#53038
…penclaw#53272) thanks @BunsDev Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com> Co-authored-by: Nova <nova@openknot.ai>
Use isSensitiveConfigPath to detect token/password/secret/apiKey paths and display REDACTED_PLACEHOLDER instead of raw values in the config diff panel, preventing credential exposure in the UI.
This fix addresses the 'Cannot redefine property: resolveMatrixAccountStringValues' error that occurs in bundled builds due to the plugin being loaded multiple times through both the setup entry and the main plugin entry. Changes: - Add isRegistered flag in index.ts to guard against duplicate registerFull() calls - Add setupInitialized flag in setup-entry.ts to guard against duplicate setup() calls - Both guards log when skipping duplicate initialization Fixes: openclaw#52780
21a7bf3 to
1d87f4b
Compare
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.
Summary
This PR fixes the "TypeError: Cannot redefine property: resolveMatrixAccountStringValues" error that occurs when loading the Matrix plugin in bundled builds.
Root Cause
The error occurs because the Matrix plugin is being loaded twice:
In bundled builds (tsdown), this can cause the module to be initialized twice, leading to the "Cannot redefine property" error.
Fix
Added idempotency guards in both entry files:
Both guards log when skipping duplicate initialization.
Testing
Fixes: openclaw#52780