From 9b956213e53debdd5c83455e5c7346c37481598f Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Mon, 25 Nov 2024 21:07:47 +0800 Subject: [PATCH 1/2] Change max message length to 200 IPhone app uses 200 chars as it's message limit. This was last updated after the introduction of PKI. Testing there revealed that with PKI the real max now is about 225, but reliability starts to dip before then. I confirmed this in testing wirh Android on a few devices just now. Change Android app to match iPhone. --- app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt index 704966499..4b330a5f2 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt @@ -140,8 +140,8 @@ class MessagesFragment : Fragment(), Logging { sendMessageInputText() } - // max payload length should be 237 bytes but anything over 235 bytes crashes the radio - binding.messageInputText.filters += Utf8ByteLengthFilter(234) + // max payload length should be 237 bytes but anything over 200 becomes less reliable + binding.messageInputText.filters += Utf8ByteLengthFilter(200) binding.messageListView.setContent { val messages by model.getMessagesFrom(contactKey).collectAsStateWithLifecycle(listOf()) From cc94fb0ba49f458400bd9464438f422fb04aedc6 Mon Sep 17 00:00:00 2001 From: Andre K Date: Mon, 25 Nov 2024 19:41:02 -0300 Subject: [PATCH 2/2] make detekt happy --- config/detekt/detekt-baseline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/detekt/detekt-baseline.xml b/config/detekt/detekt-baseline.xml index b12339f1d..927f9a593 100644 --- a/config/detekt/detekt-baseline.xml +++ b/config/detekt/detekt-baseline.xml @@ -284,7 +284,7 @@ MagicNumber:MeshService.kt$MeshService$32 MagicNumber:MeshService.kt$MeshService$60000 MagicNumber:MeshService.kt$MeshService$8 - MagicNumber:MessagesFragment.kt$MessagesFragment$234 + MagicNumber:MessagesFragment.kt$MessagesFragment$200 MagicNumber:MetricsViewModel.kt$MetricsViewModel$1000L MagicNumber:MetricsViewModel.kt$MetricsViewModel$1e-5 MagicNumber:MetricsViewModel.kt$MetricsViewModel$1e-7