-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rust/account_groups chat_list): add pin_order attribute and set_chat_pin_order method #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds chat pinning support: introduces Changes
Sequence DiagramsequenceDiagram
actor Client as Dart Client
participant FFI as FFI Bridge
participant RustAPI as Rust API
participant WN as Whitenoise
Client->>FFI: setChatPinOrder(accountPubkey, mlsGroupId, pinOrder)
FFI->>FFI: Marshal args (funcId 57)
FFI->>RustAPI: Invoke set_chat_pin_order(account_pubkey, mls_group_id, pin_order)
RustAPI->>RustAPI: Validate inputs & await
RustAPI->>WN: whitenoise.set_chat_pin_order(account_pubkey, mls_group_id, pin_order)
WN-->>RustAPI: Result/OK
RustAPI-->>FFI: Return void
FFI-->>Client: Complete Future<void>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
➡️ Coverage: 99.58% → 99.58% (0.00%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
rust/src/api/account_groups.rs (1)
18-33: Use#[frb(non_opaque)]for AccountGroup (required for Flutter compatibility).This struct is part of the Rust API surface and should follow the project guideline for non-opaque FRB structs.
♻️ Proposed fix
-#[frb] +#[frb(non_opaque)] #[derive(Debug, Clone)] pub struct AccountGroup {As per coding guidelines, apply
#[frb(non_opaque)]on structs inrust/src/api/**/*.rs.
🤖 Fix all issues with AI agents
In `@rust/src/api/chat_list.rs`:
- Around line 122-153: Reorder input parsing in set_chat_pin_order so all inputs
are parsed before performing lookups: call Whitenoise::get_instance() first,
then parse account_pubkey with PublicKey::parse and decode mls_group_id with
hex::decode / GroupId::from_slice, and only after those parses call
whitenoise.find_account_by_pubkey(&pubkey).await and then
whitenoise.set_chat_pin_order(&account, &group_id, pin_order).await; keep
existing error handling and return types intact.
80a8fa8 to
8f3bbc6
Compare
➡️ Coverage: 99.58% → 99.58% (0.00%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not related to this PR but it is a blocker for merge: Since this commit cc99f378bb80707005fc81191697f423910d28c0 in the rust crate, the signup turns to be extremely slow... from 2s to above 20s....
…chat_pin_order method
8f3bbc6 to
16fc844
Compare
➡️ Coverage: 99.6% → 99.6% (0.00%) |
Description
Adds the pin_order attribute to chat summary and accounts_groups as well as adds the set_chat_pin_order method so the app can set this value as needed
Type of Change
Checklist
just precommitto ensure that formatting and linting are correctCHANGELOG.mdfile with your changes (if they affect the user experience)Summary by CodeRabbit
New Features
Behavior Changes
Data Model
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.