Warn when the node reports contact storage is full
This commit is contained in:
1 parent
98f6cf3745
commit
966c5d74cc
23 files changed
+119
No files matched your search
@@ -271,6 +271,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
bool _batteryRequested = false;
|
bool _batteryRequested = false;
|
||||||
bool _awaitingSelfInfo = false;
|
bool _awaitingSelfInfo = false;
|
||||||
bool _hasReceivedDeviceInfo = false;
|
bool _hasReceivedDeviceInfo = false;
|
||||||
|
bool _contactsFull = false;
|
||||||
// Initial sync is serialized for predictable progress. Firmware exposes one
|
// Initial sync is serialized for predictable progress. Firmware exposes one
|
||||||
// FIFO queued-message stream, so direct/room frames are buffered until after
|
// FIFO queued-message stream, so direct/room frames are buffered until after
|
||||||
// contacts are known.
|
// contacts are known.
|
||||||
@@ -459,6 +460,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
Uint8List? get selfPublicKey => _selfPublicKey;
|
Uint8List? get selfPublicKey => _selfPublicKey;
|
||||||
String get selfPublicKeyHex => pubKeyToHex(_selfPublicKey ?? Uint8List(0));
|
String get selfPublicKeyHex => pubKeyToHex(_selfPublicKey ?? Uint8List(0));
|
||||||
String? get selfName => _selfName;
|
String? get selfName => _selfName;
|
||||||
|
bool get contactsFull => _contactsFull;
|
||||||
double? get selfLatitude => _selfLatitude;
|
double? get selfLatitude => _selfLatitude;
|
||||||
double? get selfLongitude => _selfLongitude;
|
double? get selfLongitude => _selfLongitude;
|
||||||
List<DirectRepeater> get directRepeaters => _directRepeaters;
|
List<DirectRepeater> get directRepeaters => _directRepeaters;
|
||||||
@@ -2290,6 +2292,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
_setState(MeshCoreConnectionState.connected);
|
_setState(MeshCoreConnectionState.connected);
|
||||||
if (_shouldGateInitialChannelSync) {
|
if (_shouldGateInitialChannelSync) {
|
||||||
_hasReceivedDeviceInfo = false;
|
_hasReceivedDeviceInfo = false;
|
||||||
|
_contactsFull = false;
|
||||||
_pendingInitialChannelSync = true;
|
_pendingInitialChannelSync = true;
|
||||||
}
|
}
|
||||||
await _startBleInitialSync();
|
await _startBleInitialSync();
|
||||||
@@ -2581,6 +2584,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
_selfInfoRetryTimer?.cancel();
|
_selfInfoRetryTimer?.cancel();
|
||||||
_selfInfoRetryTimer = null;
|
_selfInfoRetryTimer = null;
|
||||||
_hasReceivedDeviceInfo = false;
|
_hasReceivedDeviceInfo = false;
|
||||||
|
_contactsFull = false;
|
||||||
_resetSyncProgressState();
|
_resetSyncProgressState();
|
||||||
_bleInitialSyncStarted = false;
|
_bleInitialSyncStarted = false;
|
||||||
_pathHashByteWidth = 1;
|
_pathHashByteWidth = 1;
|
||||||
@@ -2752,6 +2756,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
_batteryRequested = false;
|
_batteryRequested = false;
|
||||||
_awaitingSelfInfo = false;
|
_awaitingSelfInfo = false;
|
||||||
_hasReceivedDeviceInfo = false;
|
_hasReceivedDeviceInfo = false;
|
||||||
|
_contactsFull = false;
|
||||||
_maxContacts = _defaultMaxContacts;
|
_maxContacts = _defaultMaxContacts;
|
||||||
_maxChannels = _defaultMaxChannels;
|
_maxChannels = _defaultMaxChannels;
|
||||||
_resetSyncProgressState();
|
_resetSyncProgressState();
|
||||||
@@ -4183,6 +4188,11 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
case pushCodeAdvert:
|
case pushCodeAdvert:
|
||||||
// Known contact was seen again - just a pub key, no action needed
|
// Known contact was seen again - just a pub key, no action needed
|
||||||
break;
|
break;
|
||||||
|
case pushCodeContactsFull:
|
||||||
|
debugPrint('Got CONTACTS_FULL');
|
||||||
|
_contactsFull = true;
|
||||||
|
notifyListeners();
|
||||||
|
break;
|
||||||
case pushCodeNewAdvert:
|
case pushCodeNewAdvert:
|
||||||
debugPrint('Got New CONTACT');
|
debugPrint('Got New CONTACT');
|
||||||
// It's the same format as respCodeContact, so we can reuse the handler
|
// It's the same format as respCodeContact, so we can reuse the handler
|
||||||
@@ -4195,6 +4205,9 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
case respCodeEndOfContacts:
|
case respCodeEndOfContacts:
|
||||||
debugPrint('Got END_OF_CONTACTS');
|
debugPrint('Got END_OF_CONTACTS');
|
||||||
_isLoadingContacts = false;
|
_isLoadingContacts = false;
|
||||||
|
if (_contactsFull && _contacts.length < _maxContacts) {
|
||||||
|
_contactsFull = false; // capacity freed up since the warning
|
||||||
|
}
|
||||||
_hasLoadedContacts = true;
|
_hasLoadedContacts = true;
|
||||||
_preserveContactsOnRefresh = false;
|
_preserveContactsOnRefresh = false;
|
||||||
_contactSyncUsesSinceFilter = false;
|
_contactSyncUsesSinceFilter = false;
|
||||||
@@ -6559,6 +6572,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
// Preserve deviceId and displayName for UI display during reconnection
|
// Preserve deviceId and displayName for UI display during reconnection
|
||||||
// They're only cleared on manual disconnect via disconnect() method
|
// They're only cleared on manual disconnect via disconnect() method
|
||||||
_hasReceivedDeviceInfo = false;
|
_hasReceivedDeviceInfo = false;
|
||||||
|
_contactsFull = false;
|
||||||
_maxContacts = _defaultMaxContacts;
|
_maxContacts = _defaultMaxContacts;
|
||||||
_maxChannels = _defaultMaxChannels;
|
_maxChannels = _defaultMaxChannels;
|
||||||
_resetSyncProgressState();
|
_resetSyncProgressState();
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ const int pushCodeNewAdvert = 0x8A;
|
|||||||
const int pushCodeTelemetryResponse = 0x8B;
|
const int pushCodeTelemetryResponse = 0x8B;
|
||||||
const int pushCodeBinaryResponse = 0x8C;
|
const int pushCodeBinaryResponse = 0x8C;
|
||||||
const int pushCodeControlData = 0x8E;
|
const int pushCodeControlData = 0x8E;
|
||||||
|
const int pushCodeContactsFull = 0x90;
|
||||||
|
|
||||||
// Contact/advertisement types
|
// Contact/advertisement types
|
||||||
const int advTypeChat = 1;
|
const int advTypeChat = 1;
|
||||||
|
|||||||
@@ -463,6 +463,7 @@
|
|||||||
},
|
},
|
||||||
"contacts_noUnreadContacts": "No unread contacts",
|
"contacts_noUnreadContacts": "No unread contacts",
|
||||||
"contacts_noContactsFound": "No contacts or groups found",
|
"contacts_noContactsFound": "No contacts or groups found",
|
||||||
|
"contacts_storageFull": "Contact storage on the node is full. New nodes cannot be added until contacts are removed.",
|
||||||
"contacts_deleteContact": "Delete Contact",
|
"contacts_deleteContact": "Delete Contact",
|
||||||
"contacts_removeConfirm": "Remove {contactName} from contacts?",
|
"contacts_removeConfirm": "Remove {contactName} from contacts?",
|
||||||
"@contacts_removeConfirm": {
|
"@contacts_removeConfirm": {
|
||||||
|
|||||||
@@ -2002,6 +2002,12 @@ abstract class AppLocalizations {
|
|||||||
/// **'No contacts or groups found'**
|
/// **'No contacts or groups found'**
|
||||||
String get contacts_noContactsFound;
|
String get contacts_noContactsFound;
|
||||||
|
|
||||||
|
/// No description provided for @contacts_storageFull.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Contact storage on the node is full. New nodes cannot be added until contacts are removed.'**
|
||||||
|
String get contacts_storageFull;
|
||||||
|
|
||||||
/// No description provided for @contacts_deleteContact.
|
/// No description provided for @contacts_deleteContact.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -1067,6 +1067,10 @@ class AppLocalizationsBg extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Няма намерени контакти или групи.';
|
String get contacts_noContactsFound => 'Няма намерени контакти или групи.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Изтрий Контакт';
|
String get contacts_deleteContact => 'Изтрий Контакт';
|
||||||
|
|
||||||
|
|||||||
@@ -1064,6 +1064,10 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'Keine Kontakte oder Gruppen gefunden.';
|
'Keine Kontakte oder Gruppen gefunden.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Kontakt löschen';
|
String get contacts_deleteContact => 'Kontakt löschen';
|
||||||
|
|
||||||
|
|||||||
@@ -1045,6 +1045,10 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'No contacts or groups found';
|
String get contacts_noContactsFound => 'No contacts or groups found';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Delete Contact';
|
String get contacts_deleteContact => 'Delete Contact';
|
||||||
|
|
||||||
|
|||||||
@@ -1061,6 +1061,10 @@ class AppLocalizationsEs extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'No se encontraron contactos ni grupos.';
|
'No se encontraron contactos ni grupos.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Eliminar contacto';
|
String get contacts_deleteContact => 'Eliminar contacto';
|
||||||
|
|
||||||
|
|||||||
@@ -1065,6 +1065,10 @@ class AppLocalizationsFr extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Aucun contact ou groupe trouvé.';
|
String get contacts_noContactsFound => 'Aucun contact ou groupe trouvé.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Supprimer le contact';
|
String get contacts_deleteContact => 'Supprimer le contact';
|
||||||
|
|
||||||
|
|||||||
@@ -1057,6 +1057,10 @@ class AppLocalizationsHu extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Nem található névjegy vagy csoport';
|
String get contacts_noContactsFound => 'Nem található névjegy vagy csoport';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Névjegy törlése';
|
String get contacts_deleteContact => 'Névjegy törlése';
|
||||||
|
|
||||||
|
|||||||
@@ -1063,6 +1063,10 @@ class AppLocalizationsIt extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Nessun contatto o gruppo trovato.';
|
String get contacts_noContactsFound => 'Nessun contatto o gruppo trovato.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Elimina Contatto';
|
String get contacts_deleteContact => 'Elimina Contatto';
|
||||||
|
|
||||||
|
|||||||
@@ -1006,6 +1006,10 @@ class AppLocalizationsJa extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => '連絡先またはグループは見つかりませんでした。';
|
String get contacts_noContactsFound => '連絡先またはグループは見つかりませんでした。';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => '連絡先を削除';
|
String get contacts_deleteContact => '連絡先を削除';
|
||||||
|
|
||||||
|
|||||||
@@ -1009,6 +1009,10 @@ class AppLocalizationsKo extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => '연락처 또는 그룹이 검색되지 않았습니다.';
|
String get contacts_noContactsFound => '연락처 또는 그룹이 검색되지 않았습니다.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => '연락처 삭제';
|
String get contacts_deleteContact => '연락처 삭제';
|
||||||
|
|
||||||
|
|||||||
@@ -1055,6 +1055,10 @@ class AppLocalizationsNl extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Geen contacten of groepen gevonden.';
|
String get contacts_noContactsFound => 'Geen contacten of groepen gevonden.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Verwijder Contact';
|
String get contacts_deleteContact => 'Verwijder Contact';
|
||||||
|
|
||||||
|
|||||||
@@ -1073,6 +1073,10 @@ class AppLocalizationsPl extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'Brak znalezionych kontaktów ani grup.';
|
'Brak znalezionych kontaktów ani grup.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Usuń Kontakt';
|
String get contacts_deleteContact => 'Usuń Kontakt';
|
||||||
|
|
||||||
|
|||||||
@@ -1063,6 +1063,10 @@ class AppLocalizationsPt extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'Não foram encontrados contatos ou grupos.';
|
'Não foram encontrados contatos ou grupos.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Excluir Contato';
|
String get contacts_deleteContact => 'Excluir Contato';
|
||||||
|
|
||||||
|
|||||||
@@ -1064,6 +1064,10 @@ class AppLocalizationsRu extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Контакты или группы не найдены';
|
String get contacts_noContactsFound => 'Контакты или группы не найдены';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Удалить контакт';
|
String get contacts_deleteContact => 'Удалить контакт';
|
||||||
|
|
||||||
|
|||||||
@@ -1052,6 +1052,10 @@ class AppLocalizationsSk extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'Neboli nájdených žiadnych kontaktov ani skupiny.';
|
'Neboli nájdených žiadnych kontaktov ani skupiny.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Odstrániť kontakt';
|
String get contacts_deleteContact => 'Odstrániť kontakt';
|
||||||
|
|
||||||
|
|||||||
@@ -1052,6 +1052,10 @@ class AppLocalizationsSl extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Stiki niso najdeni.';
|
String get contacts_noContactsFound => 'Stiki niso najdeni.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Izbriši stik';
|
String get contacts_deleteContact => 'Izbriši stik';
|
||||||
|
|
||||||
|
|||||||
@@ -1046,6 +1046,10 @@ class AppLocalizationsSv extends AppLocalizations {
|
|||||||
String get contacts_noContactsFound =>
|
String get contacts_noContactsFound =>
|
||||||
'Inga kontakter eller grupper hittades.';
|
'Inga kontakter eller grupper hittades.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Ta bort Kontakt';
|
String get contacts_deleteContact => 'Ta bort Kontakt';
|
||||||
|
|
||||||
|
|||||||
@@ -1059,6 +1059,10 @@ class AppLocalizationsUk extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => 'Контактів або груп не знайдено.';
|
String get contacts_noContactsFound => 'Контактів або груп не знайдено.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => 'Видалити контакт';
|
String get contacts_deleteContact => 'Видалити контакт';
|
||||||
|
|
||||||
|
|||||||
@@ -992,6 +992,10 @@ class AppLocalizationsZh extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get contacts_noContactsFound => '未找到任何联系人或群聊';
|
String get contacts_noContactsFound => '未找到任何联系人或群聊';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get contacts_storageFull =>
|
||||||
|
'Contact storage on the node is full. New nodes cannot be added until contacts are removed.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get contacts_deleteContact => '删除联系人';
|
String get contacts_deleteContact => '删除联系人';
|
||||||
|
|
||||||
|
|||||||
@@ -882,6 +882,31 @@ class _ContactsScreenState extends State<ContactsScreen>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (connector.contactsFull)
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
color: Theme.of(context).colorScheme.errorContainer,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.warning_amber_rounded,
|
||||||
|
size: 18,
|
||||||
|
color: Theme.of(context).colorScheme.onErrorContainer,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
context.l10n.contacts_storageFull,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: Theme.of(context).colorScheme.onErrorContainer,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: () => connector.getContacts(),
|
onRefresh: () => connector.getContacts(),
|
||||||
|
|||||||
Reference in new issue
Block a user