Skip to content

Conversation

lucasfernog
Copy link
Member

the backend expects the command name to be in snake case

we've made this change already for check_permissions and request_permissions, but missed register_listener

the backend expects the command name to be in snake case

we've made this change already for check_permissions and request_permissions, but missed register_listener
@lucasfernog lucasfernog requested a review from a team as a code owner August 31, 2025 20:11
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Aug 31, 2025
Copy link
Contributor

github-actions bot commented Aug 31, 2025

Package Changes Through bd253c6

There are 9 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.4.2
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars
Copy link
Member

No we did not miss it, we reverted it because for some unknown reason snake case didn't work: #11423

@lucasfernog
Copy link
Member Author

oh ok i'll need to dig deeper

@FabianLars
Copy link
Member

good luck 😅 i hope you can find it. i couldn't make sense of it. especially since it appears to be a bit inconsistent at times.

@lucasfernog
Copy link
Member Author

well like someone once said, the whole permission validation is a bit.. messy, crazy flow

Copy link
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

Correct me if I'm wrong

  • On desktop, we match the ACL and the command by the exact command names
  • On mobile, we still use the exact command names when matching ACLs, but we transform the command calls to camelCase

heck::AsLowerCamelCase(message.command).to_string(),

And from the current casing conventions, registerListener seems to be an outlier? I know we can't change that in v2 or we break existing ones that uses the camelCase though

&acl_origin,
)
.or_else(|| {
if request.cmd.chars().any(|c| c.is_uppercase()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I honestly don't like this, it means we now match the commands in different casing without formal documentation, and that's confusing, I'd rather use a try catch call in the addPluginListener function

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we just have a particular case for registerListener then? i don't really want to make two calls for a single command :/

Copy link
Member Author

Choose a reason for hiding this comment

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

well i'll just go with your idea.. better than bloating the rust side with a lot of temp logic :(

@lucasfernog lucasfernog merged commit 08bda64 into dev Oct 6, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Oct 6, 2025
@lucasfernog lucasfernog deleted the fix/register-plugin-listener branch October 6, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

3 participants