Contact discovery#251
Conversation
- Implemented contact settings in localization files for Swedish, Ukrainian, and Chinese. - Added new DiscoveryContact model to handle discovered contacts. - Created DiscoveryScreen to display discovered contacts with filtering and sorting options. - Integrated contact discovery storage to persist discovered contacts. - Updated settings screen to include options for automatic contact addition. - Enhanced app bar and list filter widgets for better user experience. - Fixed variable naming inconsistencies in contact model.
…nd simplify query matching
… languages - Translated contact settings and related strings in Slovenian, Swedish, Ukrainian, Chinese, Dutch, Polish, Portuguese, Russian, and Slovak. - Added new strings for discovered contacts actions such as adding, copying, and deleting contacts. - Enhanced the DiscoveryContact model to include a rawPacket field for better data handling. - Updated the contacts screen to support new actions in the context menu for discovered contacts. - Improved the contact discovery store to handle the serialization of the new rawPacket field.
There was a problem hiding this comment.
Pull request overview
Adds a “Discovered Contacts” flow to surface incoming adverts separately from the main contacts list, plus device-controlled settings for which advert types should be auto-added.
Changes:
- Introduces a Discovery screen + filtering/search to review and import/remove discovered contacts.
- Adds persistence for discovered contacts and updates
MeshCoreConnectorto track discovery + auto-add flags. - Extends the protocol layer with auto-add config frames/flags and updates localizations for the new UI strings.
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/widgets/list_filter_widget.dart | Adds a filter menu variant for Discovery contacts. |
| lib/widgets/app_bar.dart | Extends AppBarTitle with toggles for subtitle/indicators visibility. |
| lib/utils/contact_search.dart | Adds query matching helper for DiscoveryContact. |
| lib/storage/contact_discovery_store.dart | New store for persisting discovered contacts via prefs. |
| lib/services/ble_debug_log_service.dart | Updates debug labels for the new response code name. |
| lib/screens/settings_screen.dart | Adds Contact Settings entry + auto-add config dialog. |
| lib/screens/discovery_screen.dart | New Discovery UI for browsing/importing discovered contacts. |
| lib/screens/contacts_screen.dart | Adds navigation entry to the Discovery screen + updates clipboard import parsing. |
| lib/models/discovery_contact.dart | New model for discovered contacts (raw advert packet + metadata). |
| lib/models/contact.dart | Fixes constant name usage for contactLastModOffset. |
| lib/l10n/app_en.arb | Adds new English strings for contact discovery/settings. |
| lib/l10n/app_de.arb | Adds new German strings for contact discovery/settings. |
| lib/l10n/app_es.arb | Adds new Spanish strings for contact discovery/settings. |
| lib/l10n/app_fr.arb | Adds new French strings for contact discovery/settings. |
| lib/l10n/app_it.arb | Adds new Italian strings for contact discovery/settings. |
| lib/l10n/app_nl.arb | Adds new Dutch strings for contact discovery/settings. |
| lib/l10n/app_pl.arb | Adds new Polish strings for contact discovery/settings. |
| lib/l10n/app_pt.arb | Adds new Portuguese strings for contact discovery/settings. |
| lib/l10n/app_ru.arb | Adds new Russian strings for contact discovery/settings. |
| lib/l10n/app_sk.arb | Adds new Slovak strings for contact discovery/settings. |
| lib/l10n/app_sl.arb | Adds new Slovenian strings for contact discovery/settings. |
| lib/l10n/app_sv.arb | Adds new Swedish strings for contact discovery/settings. |
| lib/l10n/app_uk.arb | Adds new Ukrainian strings for contact discovery/settings. |
| lib/l10n/app_zh.arb | Adds new Chinese strings for contact discovery/settings. |
| lib/l10n/app_bg.arb | Adds new Bulgarian strings for contact discovery/settings. |
| lib/l10n/app_localizations.dart | Adds new localization getters for discovery/settings UI. |
| lib/l10n/app_localizations_en.dart | Implements new getters for English localization class. |
| lib/l10n/app_localizations_de.dart | Implements new getters for German localization class. |
| lib/l10n/app_localizations_es.dart | Implements new getters for Spanish localization class. |
| lib/l10n/app_localizations_fr.dart | Implements new getters for French localization class. |
| lib/l10n/app_localizations_it.dart | Implements new getters for Italian localization class. |
| lib/l10n/app_localizations_nl.dart | Implements new getters for Dutch localization class. |
| lib/l10n/app_localizations_pl.dart | Implements new getters for Polish localization class. |
| lib/l10n/app_localizations_pt.dart | Implements new getters for Portuguese localization class. |
| lib/l10n/app_localizations_ru.dart | Implements new getters for Russian localization class. |
| lib/l10n/app_localizations_sk.dart | Implements new getters for Slovak localization class. |
| lib/l10n/app_localizations_sl.dart | Implements new getters for Slovenian localization class. |
| lib/l10n/app_localizations_sv.dart | Implements new getters for Swedish localization class. |
| lib/l10n/app_localizations_uk.dart | Implements new getters for Ukrainian localization class. |
| lib/l10n/app_localizations_zh.dart | Implements new getters for Chinese localization class. |
| lib/l10n/app_localizations_bg.dart | Implements new getters for Bulgarian localization class. |
| lib/connector/meshcore_protocol.dart | Adds auto-add config commands/flags + introduces hex2Uint8List and updates import frame signature. |
| lib/connector/meshcore_connector.dart | Tracks discovered contacts + auto-add flags; routes adverts into contacts vs discovery; persists discovery cache. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…andling logic refactor(settings): extract settings sending logic into a separate method refactor(ble_debug_log_service): remove unused command case for radio settings refactor(app_bar): update compact width threshold for app bar display
43c1bf9 to
fcab69f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The Discovery Screen works on my testbuild, Repeater gets added to Discovery, User due to autoAdd direct in Contact list. I can Add Contacts from the Discovery list. Sincerely Eric (State of Testbuild: commit fcab69f) |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddeb1edc2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Implemented a new method to remove all discovered contacts from the list. - Added confirmation dialog for deleting all discovered contacts in the discovery screen. - Updated localization files to include new strings for deleting all discovered contacts. - Refactored contact import logic to streamline the process. - Enhanced the discovery handling to notify users appropriately based on settings.
|
Contacts that are deleted get moved into discovered and can be re-added from the list. #define CMD_SET_AUTOADD_CONFIG 58 This is the commit that added them: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38856c67e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
efddf1d to
38856c6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
lib/connector/meshcore_connector.dart:4140
removeAllDiscoveredContacts()clears the in-memory list but does not persist the empty list to storage. After reconnect/restart,loadDiscoveredContactCache()will reload the old contacts. Persist the cleared state (and consider awaiting/unawaiting it consistently).
required this.pathBytes,
required this.payload,
});
lib/connector/meshcore_connector.dart:2193
_checkManualAddContacts()is declaredasyncbut returnsvoid. Since it’s invoked from the RX frame handler withoutawait, any exception will be unhandled and harder to debug. Make it returnFuture<void>and call it withunawaited(...)(orawaitit where appropriate).
/// Calculate timeout for a message based on radio settings and path length
/// Returns timeout in milliseconds, considering number of hops
int calculateTimeout({required int pathLength, int messageBytes = 100}) {
// If we have radio settings, use them for accurate calculation
if (_currentFreqHz != null &&
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zjs81
left a comment
There was a problem hiding this comment.
Please review all the copilot comments and see if they are issues
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| publicKey = packet.readBytes(32); | ||
| timestamp = packet.readInt32LE(); | ||
| //TODO add signature verification | ||
| packet.skipBytes(64); // Skip signature for now | ||
| final flags = packet.readByte(); | ||
| type = flags & 0x0F; |
There was a problem hiding this comment.
importContact parses an advertised contact from untrusted clipboard data, reads publicKey and timestamp, and then skips over a 64-byte signature without verifying it, so the app fully trusts contact identity and metadata from an unauthenticated blob. An attacker who can trick a user into importing a crafted meshcore://... string can spoof arbitrary public keys, names, locations, and paths (including impersonating existing contacts) and have them treated as legitimate contacts. You should cryptographically verify the advert signature (using the advertised public key and the same scheme as the firmware) and discard or ignore frames whose signature does not validate before creating DiscoveryContact instances.
Adds the contact discovery functionality, along with settings for controlling the companion's auto-adding of contacts.
This should close issue #21
_handleRadioSettings was removed.