Commit Graph
128 Commits
Author SHA1 Message Date
zjs81 603172b3ec Batch per-frame persistence so busy meshes don't stall the UI isolate
Every received packet copy re-saved its channel's whole history, every
unread change re-saved the channel list, and adverts/path records re-saved
full contact and path-history blobs. Under load the SharedPreferences
backlog starved the Dart event loop (frames and timers stopped), the radio's
offline queue overflowed, and CPU stayed pinned after traffic ended.

- Add CoalescedWrites: keeps the latest write per key and runs them once
  per window (750 ms; 5 s for path history). Writes start synchronously so
  stores still read the current scoped key.
- Flush before the app is backgrounded, on disconnect, before switching
  radios, before the channel slot map changes, before channel history
  reloads, before deleteChannel drops a list, and before path history
  reloads an evicted contact.
- Cap in-memory channel history at ChannelMessageStore.maxStoredMessages;
  storage already kept only that many, but the list grew unbounded during a
  session and every save grew with it.
- Cache Contact.publicKeyHex and build pubKeyToHex from a hex-digit lookup; it was
  rebuilt on every equality/hash and per-advert contact scan.

Load test (fake TCP radio, 350 contacts, 17 channels, 10-150 packets/s,
Linux profile build): CPU at 10 packets/s 104% -> 45%, recovers to idle
after traffic instead of staying at 160%, and queued messages drained went
from 555 to 3237 over the same run.
2026-10-24 23:38:28 -07:00
zjs81 a4670a9275 Add a setting to show link images in all chats by default
'Show link images in all chats by default' (default off) applies to
every channel and contact without an explicit per-chat choice: the
per-chat setting is now unset/on/off and resolves to perChat ?? default.
The 'Load images from links' master switch still overrides it.
2026-10-24 22:01:30 -07:00
zjs81 79e3668c18 Add a global switch to stop loading images from links
'Load images from links' (default on) gates every link image fetch in
MessageUrlImageHelper: chat previews, notification images, ipfs://
resolution and pyx/ibb scraping. Per-chat toggles keep their values but
are disabled while it is off. IPFS uploads are unaffected.
2026-10-24 22:01:29 -07:00
zjs81 ee302f647b Keep the public IPFS gateway the user chose
Default to https://ipfs.io/ipfs/ like dev, keep saved gateways as they
are, and keep an explicitly cleared gateway deactivated across restarts
instead of rewriting public gateways to empty on every load.
2026-10-24 22:01:11 -07:00
zjs81 7e7e7a48db Merge remote-tracking branch 'origin/dev' into pr-593
# Conflicts:
#	lib/models/app_settings.dart
#	lib/screens/channel_chat_screen.dart
#	lib/screens/chat_screen.dart
#	untranslated.json
2026-10-24 21:45:13 -07:00
zjs81 7c2f481520 Merge remote-tracking branch 'origin/dev' into fix/ui-issues
# Conflicts:
#	untranslated.json
2026-10-24 21:13:02 -07:00
zjs81 1e786b24ba Make the map path trace builder explicit and keep its state
The builder panel now labels its actions, lets the user pick round trip
or as-entered with an explanation, and only sends when "Run path trace"
is pressed. Hops, mode and the last result are kept in UiViewStateService
for the session, so going back no longer clears them and the last result
can be reopened without sending again.
2026-10-24 21:02:19 -07:00
zjs81 c296597a2d Show the routing key prefix on each contact
Contacts now show the first path-hash-width bytes of their public key as
a monospace badge before the path label, so they can be matched to hops
in routing paths and told apart. The width follows the radio's path hash
size setting.
2026-10-24 20:59:59 -07:00
zjs81 f667320608 Fix review findings in channel notification modes
- Detect mentions on the original text, as @[name] or a whole-word @name
- Save and restore the full mode map in review mode
- Open the mode picker from the chat bell and show the mode in its tooltip
- Share one mode picker sheet; fix the stale sheet context
- Persist modes by name and skip unknown entries
- Keep writing muted_channels so older builds keep the user's mutes
- Remove the muteChannel/unmuteChannel/isChannelMuted shims
- Update notifications docs to match the behaviour
2026-10-24 20:46:49 -07:00
edouard caad3dd703 feat: add per-channel notification modes (all/mentions only/muted)
- Add ChannelNotificationMode enum with all, mentionsOnly, muted options
- Replace mutedChannels Set with channelNotificationModes Map for per-channel settings
- Add mention detection for @username in channel messages
- Update channels list and chat UI with notification mode selector
- Add localization strings for new notification modes
- Automatic migration from old mutedChannels to new system
- Update user documentation
- Preserve backward compatibility with existing mute/unmute API
2026-10-23 22:37:49 +02:00
ZIERandCopilot 4000c49213 Merge zjs81/dev into ez_share_urlimage_PR
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-13 10:16:13 +02:00
zjs81 c18b509d7e Merge remote-tracking branch 'origin/dev' into feat/network-map
# Conflicts:
#	lib/connector/meshcore_connector.dart
2026-10-11 21:55:22 -07:00
zjs81 bc14de586f Add opt-in network map uploads and online map view
- Opt-in upload of header-only packet records and repeater/room server
  adverts to map.meshcoreopen.org about once a minute; payloads, channel
  and DM hashes and transport codes are stripped on the phone, locations
  snapped to a ~2 km grid, install ID rotates daily
- One-time opt-in dialog on first radio connection; toggle and status in
  App settings
- Local / Online / Both switch on the map screen with online repeater
  hexagons, links, add-to-contacts and manage
- Node purchase banner on the connect screen (affiliate link, disclosed)
- Privacy policy and network map documentation
- Translations for all locales
2026-10-11 21:54:16 -07:00
zjs81 679116ed03 Key per-channel storage by PSK-derived channel ID
Channel messages, settings, region, order and images were persisted by
radio slot index, so a slot reused for a different channel inherited the
old channel's history and settings (#359).

- Channel.storageId: first 8 bytes of SHA-256("meshcore-channel:" + psk).
- All per-channel stores key by channel ID; in-memory state stays by slot.
- The connector keeps a slot -> channel ID map, diffs it against the saved
  map on every channel sync and reloads slots whose channel changed.
- Queued channel frames wait until this session's map is confirmed.
- One-shot per-radio migration from slot keys, using the cached channel
  list the legacy data was written under; rerun-safe if interrupted.
- Deleting a channel clears its data; a channel removed elsewhere keeps its
  history and gets it back when re-added. A PSK edit keeps its place in
  the custom order.
- Slots sharing a PSK share history and settings.
- Image entries record their channel ID; a slot change resets that slot's
  in-progress reassembly.
2026-10-11 17:52:59 -07:00
ericz a4a7e00732 upload url image or file to ipfs 2026-10-11 13:14:14 +02:00
zjs81 5fb67abdde Merge dev; fix share-location and discovered-contact import/export; update docs
Merge dev (#588 share location, #436 discovered-contact import/export)
into fix/review-fixes-and-issue-batch. Conflicts: keep the node-scan
button alongside dev's import/export menu; take dev's marker label
prompt.

Share location (#588):
- Never share a missing or 0,0 radio position; hide the chat action and
  show "Your radio has no location set"
- Sanitise marker labels ('|' -> '/', newlines -> spaces) on every path
- One shared MarkerLabelDialog owning its controller/focus node, with
  keyboard submit, replacing three copies
- Map pins default to "Point of interest" again; "Share my location"
  uses the node name
- Location shares honour the send cooldown and handle send errors

Discovered-contact import/export (#436):
- Per-entry decoding with imported/skipped/invalid counts; reject keys
  that are not 32 bytes; skip in-file duplicates and the radio's own key
- Strip routing paths on import and stop exporting them; clamp future
  timestamps; enforce the discovered-contact cap; require a connection;
  2 MB file limit
- Export via in-memory XFile (fixes web); pass sharePositionOrigin for
  iPad (also GPX export and image save); macOS user-selected read-write
  entitlement for save dialogs

Docs: cover share location, import/export, node scan, TCP reconnect,
channel auto-resend options, arrival ordering, badge, password length
and image limits.

Translations for all new strings in every locale.
2026-10-11 01:54:07 -07:00
zjs81 3cfa6a786a Merge dev into ez_import_export_5
Resolve pubspec.yaml conflict (keep dev's share_plus ^13.3.1 and
file_selector), regenerate localizations, and add the missing
map_labelUpdateHint translation for all locales.
2026-10-11 01:42:48 -07:00
zjs81 25f197c979 Fix review findings, add default flood scope, and address recent issues
Review fixes:
- Keep stored message history beyond the 200-message window; stop
  messages leaking between radios; reset link/session state on disconnect
- Accept firmware's 176-byte RX frames over USB/TCP
- Hold APP_START during contact sync; contact-sync watchdog; replay DMs
  from not-yet-known senders; tombstone late command replies; finish
  channel sync on ERR_NOT_FOUND; fail region-scoped sends cleanly
- DM retry watchdog when RESP_CODE_SENT never arrives; late repeater CLI
  replies; ACK hash collisions; UTF-8-safe name truncation
- Image pipeline: delete-during-decode, lifecycle cancels, decoder memory
  release, entry cap, dead worker recovery, atomic model writes
- Storage: deterministic reaction hash across web/native, Smaz
  double-decode, per-entry parsing, per-radio path history and regions,
  review-mode data isolation
- UI: safe channel slot selection, byte-length name limits, double-send
  guard, mounted checks, localized hardcoded strings
- Skip persisted-store reload on repeat SELF_INFO

Features:
- Radio default flood scope (firmware ver 11+) and explicit unscoped
  sends (ver 12+)
- Scan for nearby nodes (#570)
- Optional distinct first-hop repeater counting for channel resend (#589)
- Optional region next to hop count (#580)

Issues:
- Message text follows system font size (#569)
- Repeater/room password field accepts 20 chars (#576)
- TCP auto-reconnect and keepalive (#571)
- Order feeds by local receive time; flag future timestamps (#584)
- Coding rate help text (#568), French "Favoris" (#575)
- iOS/macOS app badge now clears

Translations for all new strings in every locale.
2026-10-11 01:25:31 -07:00
zjs81 ef53b8f390 Default discovered-contact eviction on and harden the auto-add dialog
- Default evictDiscoveredContactsEnabled to true so the 500-entry cap stays
  in effect unless the user opts out
- Evict until under the cap when adding, so an oversized list recovers
- Pass the cap into the localized subtitle instead of hard-coding 500
- Fix German title and subtitle wording
- Save: block double taps, send radio config first, show an error if
  persisting the setting fails
- Restore untranslated.json to match dev
2026-10-07 21:12:59 -07:00
zjs81 956c779e2c Merge branch 'dev' into ez_disable_discoveredContact_eviction_PR 2026-10-07 20:59:37 -07:00
ericz 38eef0970e update to zjs81/dev 9334d55 2026-09-28 20:02:32 +02:00
zjs81 25f8d6ae27 Add notification replies, Android Auto support, and channel mute bell
- Message notifications use Android MessagingStyle with Reply, Mark as read,
  and Mute channel actions, so they work in Android Auto and on watches
- Replies go through the normal send path (length limits, SMAZ, Cyr2Lat,
  retries), split into up to 3 messages, and report failures
- Declare Android Auto notification support and register the action receiver
- Add a bell icon to channel chat to mute/unmute; unify the channel mute key
  so unnamed channels mute correctly
- Update README and docs for Android Auto support
2026-09-27 21:55:43 -07:00
zjs81 7134bac7f7 Merge remote-tracking branch 'origin/dev' into ez_display_region
# Conflicts:
#	lib/connector/meshcore_connector.dart
#	lib/models/channel_message.dart
#	lib/screens/channel_chat_screen.dart
2026-09-27 12:37:45 -07:00
zjs81 0e8a8bd8c4 Add unit tests for ChannelMessage replies and update untranslated.json with new translations 2026-09-25 13:23:07 -07:00
Zach d74587c167 Refactor LoRa airtime tests and add new functionality
- Updated LoRa airtime calculations in `lora_airtime_test.dart` to reflect new reference values.
- Introduced new tests for LDRO behavior and preamble symbol calculations.
- Added `contact_path_width_test.dart` to validate path hash width handling in contacts.
- Enhanced `model_changes_test.dart` to ensure legacy data migration works correctly.
- Created `remote_node_stats_test.dart` to decode and validate remote node statistics.
- Implemented `map_marker_parse_test.dart` for parsing marker text with coordinate validation.
- Developed `map_tile_cache_key_test.dart` to ensure API keys are excluded from cache keys.
- Added `message_retry_failure_test.dart` to test message retry service behavior on failures.
- Extended `path_history_service_test.dart` to preserve learned state across path attempts.
- Enhanced `received_image_store_test.dart` to handle concurrent writes and review fixes.
- Implemented `repeater_command_service_test.dart` to validate command response handling.
- Created `store_tolerant_parsing_test.dart` to ensure stores skip malformed records gracefully.
- Cleared untranslated JSON file for localization updates.
2026-09-25 10:01:18 -07:00
ericz 20e01145e6 display Regions in received Messages and allow reply to same region. 2026-09-21 17:52:33 +02:00
ericz cf027c974f update to zjs81/dev commit d5f54df 2026-09-21 16:11:40 +02:00
ericz 213f3e3971 update to zjs81/dev commit d5f54df 2026-09-21 15:59:53 +02:00
zjs81 d5f54dfa11 Merge pull request #537 from sethoscope/mc1-reactions
Handle MeshCoreOne's emoji reactions
2026-09-20 23:12:41 -07:00
shortwavesurfer2009 34e3ec7324 max power on USA presets 2026-09-09 21:24:02 -04:00
ericz 4480c0d356 Merge remote-tracking branch 'zjs81/dev' into ez_disable_discoveredContact_eviction_PR 2026-09-08 18:09:32 +02:00
kyleyank 6879abe84b Adding preset for Philly per latest blog post 2026-09-03 17:34:08 -04:00
Seth Golub 97f20eaec0 Handle MeshCoreOne's emoji reactions
MeshCoreOne is a companion app that supports emoji reactions, using a
different message format than ours.

This commit adds support for parsing and displaying reactions received
in the MeshCoreOne format.

Their format is described here:
 https://github.com/Avi0n/MeshCoreOne/blob/main/docs/Reactions.md

Here's an example:

👍@[entropy]
b3je6qf7

Major differences compared to MeshCore-Open's reaction messages:
- includes the emoji, rather than an index code
- includes the name of who sent the message it refers to
- the hash does not depend on the sender name
2026-08-30 14:34:38 -07:00
zjs81 e9b7e8132b Merge branch 'dev' into emoji-reation-report 2026-08-25 13:38:55 -07:00
ericz 1dbb487fe7 fix dart analyze bracket error. 2026-08-11 19:26:41 +02:00
ericz fd9679a556 update to zjs81/dev 724696cd3c 2026-08-11 19:17:09 +02:00
zjs81 cf6c93c50a rebuild translations 2026-08-11 00:15:45 -07:00
Zach eee72b4c65 Add ability to send images over lora 2026-08-10 23:20:46 -07:00
Zach 736eb064bf Update RadioSettings preset with new spreading factor and coding rate 2026-08-09 19:55:01 -07:00
Seth Golub 76b34779cf Add emoji reaction report for channel chat, fix reaction deduping bug
In channel chat screen, clicking a reaction emoji brings up a popup
listing the received emoji reactions and their senders.

Also fixes a bug that prevented displaying the count numbers on
reactions. Code existed to display counts for multiples, but the
deduplication failed to differentiate between senders and was tossing
them out.

There is still another preexisting bug, not fixed by this commit, that
over-counts sent reactions in rooms.
2026-08-07 21:24:00 -07:00
ericz 1fc6a9bf68 update to zjs81/dev 98f6cf3745 2026-08-04 17:43:52 +02:00
ericz b15f6450bd dart format 2026-08-04 17:27:51 +02:00
ZIER 9db2307ea0 add setting to enable eviction of discovered contacts in settings 2026-08-03 09:04:36 +02:00
PacoX a8cac76491 resolved conflict and update doc 2026-07-09 09:08:50 +02:00
zjs81 b8e113d269 Merge pull request #467 from sethoscope/set-repeater-key
Add UI for setting repeater identity keys
2026-07-06 09:23:01 -07:00
zjs81 0f3961f3a2 Merge pull request #461 from ericszimmermann/ez_alternative_maps
Alternative Maps
2026-07-04 00:32:58 -07:00
ericszimmermann c1dea86dd1 Merge branch 'zjs81:dev' into ez_zerohop_location_advert_PR 2026-07-01 07:27:44 +02:00
km-foss eb89ad1d50 chore: Add Australia (Mid) Radio Preset
This mirrors the config option from the official Meshcore app, and represents the preset now commonly in use in New South Wales.
2026-06-24 09:21:45 +10:00
ericz 5ef976b3b5 Add option for automatic zerohop adverts on posision change. 2026-06-23 18:19:22 +02:00
Seth Golub e1a4900dc0 Add UI for setting repeater identity keys
This adds a simple UI in repeater management settings for remotely
setting a repeater's private key. A key can be pasted from an external
key generator, or a random one can be generated here, optionally with a
specified prefix.

If a prefix is specified, searching is done in 30ms batches in order
to keep the UI responsive and show the progress indicator animation
smoothly. Searches can be interrupted. An estimation of search length is
given as expected number of generated key pairs. (A future improvement
would be to observe keys per second performance and give time estimates
based on that.)

When it generates a new private key on your behalf, it can tell you
what the corresponding public key will be. Unfortunately, if you paste
one in from another source, it can't compute the corresponding public
key. This is because the standard Dart crypto library doesn't provide
that capability, nor does it give access to the elliptic curve functions
it implements so we could do it ourselves. Our only recourse would be to
copy the source for all those things, and I didn't think it was worth
it.

This will not check the validity of a pasted key, but the remote
repeater will. It does limit it to the correct length and hexadecimal
charset.

Prefixes are limited to 4 characters. There's no technical reason for
this, but users are unlikely to want more, and I think it would just be
a bad experience to allow more and spin for a very long time. If someone
really wants a longer one, they can use an external generator like they
do now.

Possible TODO: rewrite background processing using isolates.

Closes #142.
2026-06-19 07:27:44 -07:00