-
Notifications
You must be signed in to change notification settings - Fork 14
fix: remove metadata cache provider from general settings screen #560
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
fix: remove metadata cache provider from general settings screen #560
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughRefactors GeneralSettingsScreen to fetch per-account metadata directly via accountMetadata and to resolve the active account through activeAccountProvider.future. Removes metadata cache usage and fallback logic. Updates ContactModel construction to fromMetadata. Narrows accounts.dart imports to Account, getAccounts, and accountMetadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as GeneralSettingsScreen
participant Prov as activeAccountProvider
participant API as accounts.dart
participant Meta as accountMetadata
User->>UI: Open screen
UI->>Prov: read .future
Prov-->>UI: ActiveAccountState (account)
UI->>API: getAccounts()
API-->>UI: List<Account>
loop For each account
UI->>Meta: accountMetadata(pubkey)
Meta-->>UI: Metadata
UI->>UI: ContactModel.fromMetadata(publicKey, metadata)
end
UI-->>User: Render accounts with metadata
note over UI: Cache-based retrieval removed<br/>No "Unknown User" fallbacks
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
#559 fixes an issue where metadata wasn’t updating after edits, but it added logic to the metadata cache provider, which we actually want to remove.
This PR removes that provider from the General Settings screen and (hopefully) fixes the same issue as #559, unless I’m missing something.
It still relies on ContactModel, which we also want to remove. But I think it’s easier to first remove the metadata cache provider and then rename that model to something like UserData (or another better name you might suggest). The idea is to have a model that represents metadata + pubkey in a way that’s easier for widgets to handle.
Type of Change
Checklist
just precommitto ensure that formatting and linting are correctjust check-flutter-coverageto ensure that flutter coverage rules are passingCHANGELOG.mdfile with your changes (if they affect the user experience)Summary by CodeRabbit
Bug Fixes
Refactor