Skip to content

Conversation

@erskingardner
Copy link
Member

@erskingardner erskingardner commented Oct 16, 2025

Summary by CodeRabbit

  • New Features

    • Added functionality to retrieve group image paths.
  • Improvements

    • Streamlined group image upload process by simplifying parameter requirements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 16, 2025

Walkthrough

The pull request refactors the group image upload API by removing the imageType parameter across the Dart-Rust FFI boundary and introduces a new getGroupImagePath function to retrieve group image paths. Dependency revisions for mdk-core and whitenoise are updated, with additional nostr-sdk features enabled.

Changes

Cohort / File(s) Summary
Group Image Upload Refactoring
lib/config/providers/create_group_provider.dart, lib/src/rust/api/groups.dart, rust/src/api/groups.rs
Removed imageType parameter from uploadGroupImage / upload_group_image signatures and eliminated MIME type computation. Added new getGroupImagePath function to retrieve group image paths.
FFI & Dart Bridge Generation
lib/src/rust/frb_generated.dart, rust/src/frb_generated.rs
Updated FFI bindings to remove imageType from uploadGroupImage argument list. Added new wire dispatch for get_group_image_path (funcId 28) with corresponding TaskConstMeta. Adjusted downstream FFI function ID mappings to reflect API expansion.
Dependency Management & Relay API
rust/Cargo.toml, rust/src/api/relays.rs
Updated mdk-core and whitenoise dependency revisions. Added nip44, Nip47, and Nip59 to nostr-sdk features. Updated relay status API to call get_account_relay_statuses instead of fetch_relay_status.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • josefinalliende
  • Quwaysim
  • codeswot
  • jgmontoya

Poem

🐰 A rabbit's refrain on image paths so fine:

No mime-type needed, just the path divine,
Through FFI's bridge, the numbers align,
New functions spring forth as old ones resign,
Deps cascade onward—a release by design! 🌱

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title succinctly captures the core changes: bumping the Whitenoise (WN) dependency and updating the upload_group_image and get_group_image_path methods across the codebase, making it clear and specific to the changes introduced.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump-wn-mdk

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35ee2a6 and e98373f.

⛔ Files ignored due to path filters (1)
  • rust/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • lib/config/providers/create_group_provider.dart (0 hunks)
  • lib/src/rust/api/groups.dart (1 hunks)
  • lib/src/rust/frb_generated.dart (39 hunks)
  • rust/Cargo.toml (2 hunks)
  • rust/src/api/groups.rs (3 hunks)
  • rust/src/api/relays.rs (1 hunks)
  • rust/src/frb_generated.rs (4 hunks)
💤 Files with no reviewable changes (1)
  • lib/config/providers/create_group_provider.dart
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

Use the whitenoise Rust crate (via flutter_rust_bridge) as the sole data source and change trigger

Files:

  • rust/src/api/relays.rs
  • rust/src/api/groups.rs
  • rust/src/frb_generated.rs
**/*.dart

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

**/*.dart: Always declare the type of each variable and function (parameters and return value)
Avoid using dynamic and Object without justification
Create necessary types instead of overusing primitives or dynamic
One export per file
Use PascalCase for classes
Use camelCase for variables, functions, and methods
Avoid magic numbers and define constants
Start each function name with a verb
Use verbs for boolean variables (e.g., isLoading, hasError, canDelete)
Write short functions with a single purpose (under ~20 instructions)
Name functions with a verb plus context; for booleans use isX/hasX/canX; for void use executeX/saveX
Avoid deep nesting via early returns and extraction to utility functions
Use higher-order functions (map, where/filter, reduce) to avoid nesting
Use arrow functions for simple functions (under ~3 statements); use named functions otherwise
Use default parameter values instead of null checks
Reduce function parameters using RO-RO: pass/return parameter objects with declared types
Maintain a single level of abstraction within functions
Encapsulate data in composite types; avoid overusing primitives
Prefer validating data within classes rather than in functions
Prefer immutability; use final for runtime constants and const for compile-time constants
Use const constructors and const literals where possible
Follow SOLID principles
Prefer composition over inheritance
Declare interfaces (abstract classes) to define contracts
Write small classes with a single purpose (under ~200 instructions, <10 public methods, <10 properties)
Use exceptions for unexpected errors
Only catch exceptions to fix expected problems or add context; otherwise use a global handler

Files:

  • lib/src/rust/api/groups.dart
  • lib/src/rust/frb_generated.dart
lib/**/*.dart

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

lib/**/*.dart: Use flutter_rust_bridge to access core app functionality
Use Riverpod for state management; prefer StreamProviders for Rust API streams; use keepAlive if needed
Use freezed to model/manage UI states
Controllers should expose methods as inputs and update UI state that drives the UI
Use AutoRoute for navigation and use extras to pass data between pages
Use Dart extensions to manage reusable code
Use ThemeData to manage themes
Use AppLocalizations for translations
Use constants to manage constant values
Avoid deeply nested widget trees; aim for a flatter widget structure for performance and readability
Break down large widgets into smaller, focused, reusable components
Keep the widget tree shallow to simplify state management and data flow
Utilize const constructors and const widgets wherever possible to reduce rebuilds

Files:

  • lib/src/rust/api/groups.dart
  • lib/src/rust/frb_generated.dart
🧬 Code graph analysis (2)
rust/src/api/groups.rs (1)
rust/src/api/utils.rs (1)
  • group_id_from_string (56-59)
rust/src/frb_generated.rs (1)
rust/src/api/groups.rs (1)
  • get_group_image_path (382-392)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Flutter CI
🔇 Additional comments (1)
rust/src/frb_generated.rs (1)

1075-1115: LGTM! Auto-generated FFI bindings correctly implement the new API.

The new wire__crate__api__groups__get_group_image_path_impl function follows the established pattern for async SSE-based wire functions in this file. It correctly:

  • Decodes two String parameters (account_pubkey and group_id)
  • Calls crate::api::groups::get_group_image_path (as confirmed in the relevant code snippet from rust/src/api/groups.rs)
  • Returns Result<Option<String>, ApiError> via transform_result_sse

The dispatcher index mappings have been correctly shifted to accommodate the new function at index 28, with all subsequent indices incremented by 1 (29-63). The synchronous dispatcher indices (40, 44) were also adjusted accordingly.

Since this is auto-generated code by flutter_rust_bridge, these changes reflect the addition of the get_group_image_path API method to the Dart-Rust FFI boundary.

As per coding guidelines: This follows the instruction to "Use the whitenoise Rust crate (via flutter_rust_bridge) as the sole data source and change trigger."

Also applies to: 3483-3569


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@erskingardner erskingardner merged commit 935c459 into master Oct 16, 2025
2 checks passed
@erskingardner erskingardner deleted the bump-wn-mdk branch October 16, 2025 09:25
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