Skip to content

fix(core.loader): 修复容器 authority 和插件 authority 相同时返回错误 Uri 的问题#1429

Merged
shifujun merged 1 commit intoTencent:masterfrom
yanglw:master
Mar 23, 2026
Merged

fix(core.loader): 修复容器 authority 和插件 authority 相同时返回错误 Uri 的问题#1429
shifujun merged 1 commit intoTencent:masterfrom
yanglw:master

Conversation

@yanglw
Copy link
Copy Markdown
Contributor

@yanglw yanglw commented Mar 21, 2026

当容器 authority 和插件 authority 相同,通过 uriString.replace 转换 Uri 时,会将宿主和插件的 authority 都进行删除,导致返回的 Uri 错误,无法匹配真正的插件 Content Provider 。

@tencent-adm
Copy link
Copy Markdown
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yanglw yanglw force-pushed the master branch 2 times, most recently from a89e472 to a824603 Compare March 21, 2026 15:02
@shifujun
Copy link
Copy Markdown
Collaborator

这个代码时间久了点,我印象不太准了。这里的容器authority不是shadow框架写的固定的吗?或者是宿主中注册的固定的吧?是不是应该会固定成容器含义的字符串,为什么插件的authority会跟容器的相同呢?

@yanglw
Copy link
Copy Markdown
Contributor Author

yanglw commented Mar 21, 2026 via email

@shifujun
Copy link
Copy Markdown
Collaborator

建议修改2点:

  1. 提交记录标题的fix(core.runtime)改为fix(core.loader)
  2. 能否仿照projects/sdk/core/loader/src/test/kotlin/com/tencent/shadow/core/loader/classloaders/PluginClassLoaderTest.kt 给这个convert2PluginUri方法写一个单元测试?这个正则表达式还是很难用人眼看出问题的。

@yanglw
Copy link
Copy Markdown
Contributor Author

yanglw commented Mar 21, 2026 via email

@yanglw yanglw force-pushed the master branch 3 times, most recently from f408ba5 to edda039 Compare March 22, 2026 23:28
@yanglw yanglw changed the title fix(core.runtime):修复容器 authority 和插件 authority 相同时返回错误 Uri 的问题 fix(core.loader): 修复容器 authority 和插件 authority 相同时返回错误 Uri 的问题 Mar 22, 2026
Copy link
Copy Markdown
Collaborator

@shifujun shifujun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些run块的代码重复率太高了点。能否顺手重构成input和except的list for each调用。或者更好一点改成junit的ParameterizedTest?

Copy link
Copy Markdown
Collaborator

@shifujun shifujun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shifujun shifujun merged commit 4e9f70a into Tencent:master Mar 23, 2026
11 of 12 checks passed
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.

3 participants