Skip to content

Remote commands API update#33

Merged
lesleysin merged 1 commit into
v4from
remote-commands
Jul 14, 2025
Merged

Remote commands API update#33
lesleysin merged 1 commit into
v4from
remote-commands

Conversation

@lesleysin

@lesleysin lesleysin commented Jul 14, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores

    • Added a configuration file to specify the Flutter version and automate related setup tasks.
  • Refactor

    • Renamed a field and constructor parameter in the command handling logic for improved clarity.
    • Updated event handling to use the new field name for command data.
  • Style

    • Added commented-out setter examples in the UI element tree class (no impact on functionality).

…d parameter in RemoteCommand class to commandData for better readability. Updated references to payload in CommandEvent class. Commented out set viewController and set attributes methods in ElementTreeEntry class.
@lesleysin lesleysin self-assigned this Jul 14, 2025
@lesleysin lesleysin changed the title Remoter commands API update Remote commands API update Jul 14, 2025
@coderabbitai

coderabbitai Bot commented Jul 14, 2025

Copy link
Copy Markdown

Walkthrough

A new .fvmrc configuration file was introduced to specify Flutter version settings. In the Dart codebase, the RemoteCommand class and related logic were updated by renaming the payload field and parameter to commandData, and the corresponding JSON key in CommandEvent.fromJson was changed. Additionally, commented-out setter methods were added in ElementTreeEntry for future reference.

Changes

File(s) Change Summary
.fvmrc Added new configuration file specifying Flutter version 3.24.3 and related settings.
lib/src/action_api/command.dart Renamed payload field and constructor parameter to commandData in RemoteCommand.
lib/src/action_api/event.dart Updated CommandEvent.fromJson to use "commandData" key instead of "payload".
lib/src/ui/tree_element.dart Added commented-out setter methods for viewController and `attributes`` (no functional change).

Sequence Diagram(s)

sequenceDiagram
    participant JSON
    participant CommandEvent
    participant RemoteCommand

    JSON->>CommandEvent: fromJson(json)
    CommandEvent->>RemoteCommand: Construct with commandData = json["commandData"] ?? {}
    RemoteCommand-->>CommandEvent: Instance with commandData field
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d73f99 and d8b2790.

📒 Files selected for processing (4)
  • .fvmrc (1 hunks)
  • lib/src/action_api/command.dart (1 hunks)
  • lib/src/action_api/event.dart (1 hunks)
  • lib/src/ui/tree_element.dart (1 hunks)
🔇 Additional comments (3)
lib/src/action_api/command.dart (2)

7-7: LGTM: Field rename improves clarity.

The rename from payload to commandData makes the purpose more explicit and improves code readability.


12-12: All RemoteCommand usages updated to commandData

Confirmed that there are no remaining instances of the old payload parameter in RemoteCommand:

  • lib/src/action_api/command.dart – constructor now declares required this.commandData
  • lib/src/action_api/event.dart – CommandEvent.fromJson invokes RemoteCommand(..., commandData: …)

No further changes needed.

lib/src/action_api/event.dart (1)

201-201: LGTM: JSON parsing properly updated to match API change.

The update from "payload" to "commandData" correctly aligns with the field rename in the RemoteCommand class, maintaining consistency across the command API.

Comment thread .fvmrc
Comment on lines +1 to +6
{
"flutter": "3.24.3",
"updateVscodeSettings": true,
"updateGitIgnore": true,
"runPubGetOnSdkChanges": true
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify Flutter version validity and security status.

Ensure that Flutter 3.24.3 is a valid, stable version and check for any known security vulnerabilities.


🌐 Web query:

Is Flutter 3.24.3 a valid release version? Are there any known security vulnerabilities in Flutter 3.24.3?

💡 Result:

Flutter 3.24.3 is a valid release version. Community discussions and GitHub issues confirm that developers have used Flutter 3.24.3 as a stable version as recently as June 2025[7]. It is referenced in multiple community channels and bug reports as a deployed, official Flutter release[6][7][8].

Security vulnerabilities:
There is a known issue with Flutter 3.24.3 related to Intent Redirection on Android, which has been flagged as a security vulnerability. Specifically, an app built with Flutter SDK 3.24.3 was rejected by the Google Play Store due to this security issue, which can potentially expose user information or damage a device. The vulnerability is identified as intent redirection in the app's code, violating Google’s Device and Network Abuse policy[2].

We found that your app contains security vulnerabilities, which can expose user information or damage a user’s device. This is a violation of Device and Network Abuse policy. Specifically, your app(s) are vulnerable to Intent Redirection[2].

No official Flutter release notes explicitly detail this security flaw in version 3.24.3; however, user reports and Play Store feedback suggest it is a significant issue for apps targeting Android[2].

Summary Table

Version Status Known Security Issues
3.24.3 Valid/stable Yes: Intent Redirection (Android)[2]
3.27.x and above Stable Not flagged for same issue (as of date)

For the latest and most secure experience, consider upgrading to a newer Flutter version, as more recent releases like 3.27 and 3.32 are available and may address or avoid this vulnerability[1][4][7]. Always review the release notes and changelogs for security updates relative to your target platforms.

Citations:


Upgrade Flutter version to mitigate known security issue

Flutter 3.24.3 is a valid, stable release but is affected by a known Android Intent Redirection vulnerability that can cause Google Play Store rejections. Please bump the SDK to a newer stable version (e.g. 3.27.0 or above) that is not flagged for this issue.

• File needing update:

  • .fvmrc (line 2)

• Proposed change:

 {
-   "flutter": "3.24.3",
+   "flutter": "3.27.0",  // or later stable release
    "updateVscodeSettings": true,
    "updateGitIgnore": true,
    "runPubGetOnSdkChanges": true
 }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In the .fvmrc file at line 2, the Flutter SDK version is set to 3.24.3, which
has a known security vulnerability. Update the Flutter version string to a newer
stable release such as 3.27.0 or above to mitigate the Android Intent
Redirection issue and avoid Google Play Store rejections.

Comment on lines +41 to +47
// set viewController(UIElementController viewController) {
// this.viewController = viewController;
// }

// set attributes(ViewAttribute attributes) {
// this.attributes = attributes;
// }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove commented-out code or provide clear justification.

The commented-out setter methods have several issues:

  1. They contain incorrect syntax - trying to assign this.viewController = viewController where viewController is an abstract property
  2. Commented code in production should be avoided unless there's a specific reason for future reference

If these setters are planned for future implementation, consider creating a TODO comment or tracking issue instead.

-  // set viewController(UIElementController viewController) {
-  //   this.viewController = viewController;
-  // }
-
-  // set attributes(ViewAttribute attributes) {
-  //   this.attributes = attributes;
-  // }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// set viewController(UIElementController viewController) {
// this.viewController = viewController;
// }
// set attributes(ViewAttribute attributes) {
// this.attributes = attributes;
// }
🤖 Prompt for AI Agents
In lib/src/ui/tree_element.dart around lines 41 to 47, remove the commented-out
setter methods for viewController and attributes because they contain incorrect
syntax and commented code should not remain in production. If these setters are
intended for future use, replace the commented code with a clear TODO comment or
reference a tracking issue instead.

@lesleysin
lesleysin merged commit f4de132 into v4 Jul 14, 2025
3 checks passed
@lesleysin
lesleysin deleted the remote-commands branch July 14, 2025 16:22
lesleysin added a commit that referenced this pull request Nov 5, 2025
* breaking: DuitDataSource (#32)

* experiment - removing attribute support

* wip

* wip

* wip

* refacror ViewAttributes class

* Added  tests

* wip

* Added early exit from methods

* Added new functions for handling JSON parsing results, improved default result return logic, and added table mapping for BlendMode and FloatingActionButtonLocation.

* docs

* add tests

* Added tests

* Removed static mapping tables for Clip, TextAlign, TextOverflow and TextWidthBasis in the DuitDataSource class.

* Added new methods for JSON processing, including support for textDecorationStyle, fontWeight, fontStyle and other attributes. Improved logic for returning default values ​​and added corresponding tests.

* Added tests

* Removed unused methods and added new functions to handle theme rules and image filters. Updated tests to check new features and JSON processing logic.

* Upd .gitignore

* wip

* Upd tests, added Tween parser

* Removed ventilation methods, added new functions for widget handling. Updated tests to check new features and JSON handling logic.

* Refactored functions for creating InputBorder and ShapeBorder from a map, as well as corresponding lookup tables. Simplified logic for selecting the border type.

* Added docs

* upd actions config

* wip

* wip

* Update test/theme_test.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* clean dead code

* fix

* Update lib/src/view_attributes/lookup.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Added export of Command.dart file to action_api and removed it from animation_api. Updated data references in DuitDataSource class to use new "stretchModes" key. Fixes to tests to match changes in step data.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Remote commands API update (#33)

* breaking: Themes refactoring (#34)

* Registry API update: Added new RefWithTarget class, changed component initialization and registration functions, removed unused files, and improved export structure. Updated tests and removed deprecated topic tokens.

* upd workflow

* breaking: Reworking the widget model API and simplifying registration of custom widgets (#35)

* Removed unused factory_record.dart file and updated component registration logic in DuitRegistry class, removed references to model factories. Updated factory getter methods to match new changes.

* Small fix for tweens parser

* rm unused API part

* Update lib/src/registry_api/registry.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* fix

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve lootup tables for enums (#36)

* Flutter types json encoding (#37)

* Added encoding functions for: Duration, Size, EdgeInsets, TextStyle, Color, LinearGradient, BoxShadow, Offset, BoxDecoration, BorderRadius, Border, BorderSide, InputBorder, InputDecoration, VisualDensity, ScrollPhysics, ShapeBorder

* wip

* Added tests

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix tests

* Added docs

* dart format

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: action debounce and throttle configuration (#38)

* Added execution options for actions: added ExecutionOptions class with throttle and debounce modifiers, updated ServerAction classes and their descendants to support the new options. Updated parsing methods and added corresponding lookup tables for execution modifiers.

* - Added test
- Refactor DuitDataSource methods with one-line return and fail-fast approach at lookup tables work

* fix Color parsers behavior

* refactoring: improved color handling in _colorFromList function

Changed the typification function of the _colorFromList parameter from List<num> to List, added preprocessing of color data to ensure correct conversion. Updated the corresponding calls in the JSON parsing and processing methods in the DuitDataSource class.

* feat: Fragments registration in DuitRegistry (#39)

Added a new static method registerFragment for registering fragments by key and a method getFragment for receiving a fragment by key with logging in case of absence. Also added an internal registry of fragments _fragmentRegistry.

* Component system refactor (#40)

* Components refactoring via JSON patching instead of Map mutation

* Added tests for json patching and components patches generation

* Review fixes

* Upd lookup table for Curves

* Remover legacy API references

* feat: DuitDataSource methods extension (#41)

* Extend parser for BorderRadius type, added Radius type parsing, upd tests

* fix tests

* Added new Size parsing behavior

* wip

* feat: Custom json reviver (#42)

* Refactor env variables, refactor analysis issues in test files, added FlutterPropertyKeys class

* wip

* wip

* wip

* Fixed analysis issues

* wip

* Fixed getActionDependencies and childObjects methods

* Upd env variables keys

* Code review fixes

* Fix test

* Upd post-merge workflow
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.

1 participant