Commit Graph
116 Commits
Author SHA1 Message Date
zjs81 abcf6c2eae Treat an existing Kubo MFS entry as a successful share
The MFS name includes the CID, so 'already has entry' means the same
content is already there; re-sharing a file no longer fails.
2026-10-24 21:54:16 -07:00
zjs81 c2d18b431e Test IpfsUploadHelper directly and build the upload request once
Drop the test-only upload facade on MessageUrlImageHelper that
overwrote the shared HTTP client, move its tests to IpfsUploadHelper,
and build the multipart request with the final upload URI instead of
cloning it.
2026-10-24 21:54:16 -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 21098f1c34 Merge branch 'dev' into feat/dns-node-banner 2026-10-24 21:38:46 -07:00
zjs81 69693f5a89 Accept plain-text values in the node banner record
Only ';' needs encoding, so the title and body fit in one TXT string.
Values that aren't valid percent-encoding are used as-is instead of
hiding the banner.
2026-10-24 21:33:14 -07:00
zjs81 ee382f9177 Configure the connect screen's node banner from a DNS TXT record
The "get a node" banner's link, and optionally its title, body and button
text, now come from the _banner.meshcoreopen.org TXT record, looked up
over Cloudflare DNS-over-HTTPS and cached for the record's TTL (1 min to
6 h). The record is `v=1;on=1;url=<https link>` with URL-encoded values;
`on=0`, a missing record or any lookup failure hides the banner.
2026-10-24 21:29:08 -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 21e727cf21 Don't re-create a removed contact when syncing its path or flags
The firmware's CMD_ADD_UPDATE_CONTACT adds the key when it isn't in the
contact table. Screens that stay open after a contact is removed (e.g. a
repeater admin screen after the repeater's keys were changed and the old
contact deleted) sync the path before every send, so the next command,
status or telemetry request silently added the old contact back. Skip
path and flag writes for contacts no longer in the contact list.
2026-10-24 21:11:04 -07:00
zjs81 f2a27f0f71 Wait for the radio before removing a contact, and explain re-adds
removeContact now waits for the radio's reply and only drops the contact
locally when the radio confirms (or reports it doesn't have it), so a
lost command no longer leaves a contact that the next sync restores.
Failures are shown to the user. The delete dialog warns when the radio
auto-adds that contact type, since the contact returns on its next
advert.
2026-10-24 21:03:39 -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 caf20b4415 Summarize location, image and GIF messages in notifications
Notification bodies now use the chat's parsers to show a localized
summary for shared locations (m: markers), channel images, GIFs and
reactions instead of the raw payload. The marker parser moves out of the
map screen into helpers/marker_message.dart so the service can use it.
2026-10-24 21:01:06 -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 92b147bd49 Format tcp_transport_service_native_test 2026-10-24 20:57:30 -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
ericz 050016f599 ai fix tcp reconnect test fail 2026-10-24 16:46:32 +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 e614fb32e2 Address review: consent race, unsigned advert bytes, antimeridian
- Uploads carry a consent generation: nothing is sent if sharing is
  turned off while a batch is being prepared, and a late response never
  touches a queue that was cleared and refilled
- Parse only the signed 32 advert app-data bytes, as the firmware does,
  so appended unsigned bytes can't add the hidden marker or change the
  name
- Split online map requests that cross the antimeridian into two valid
  boxes and merge the results
- README: link the network map next to the website
2026-10-11 22:09:08 -07:00
zjs81 49582d3f07 Format tcp transport test for the current stable formatter 2026-10-11 22:05:29 -07: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 6a8df764bb Stamp legacy images inside the migration; hold early channel frames
- Image entries are stamped with their channel ID before the migration is
  marked done, so an interrupted run repeats it instead of leaving them
  unstamped (and invisible) forever.
- Channel message/data frames that arrive before this session's slot map
  is confirmed are held and replayed once it is. Current firmware only
  sends them in reply to SYNC_NEXT_MESSAGE, which already waits; this
  guards against a stale saved map filing them under the wrong channel.
2026-10-11 18:04:53 -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
zjs81 88dcc5943f UI refresh: shared widgets, screen cleanups, and full translations
- Extract reusable widgets (chat composer/send pipeline, message bubble
  frame, reaction chips, path map scaffold, radio settings dialog,
  translation settings section, map POI clusters, nav tiles, etc.) and
  slim down the screens that used them
- Map: hide/remove markers with restore, confirm before setting node
  location, POI clustering, semantics labels
- Map cache: cancellable downloads and a bulk tile limit
- Repeater: unsaved-changes guard, CLI search/copy/share transcript,
  framed-command debug preview, disconnected banner
- Confirm before clearing chats and debug logs
- Keep cached unread totals in sync on per-contact/channel updates
- Move remaining hardcoded strings into l10n and translate the 98 new
  keys into all 17 non-English locales
2026-10-11 15:17:01 -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 616c433922 Let entry cap remove spent outgoing images; clarify channel row arrival ordering
Outgoing image entries were excluded from the maxEntries cap, and age
eviction only marks them evicted, so frequent senders accumulated entries
and sidecars without bound. Outgoing entries with nothing left on disk (or
failed) are now eligible, oldest first.

Rename _ChannelChatRow.timestamp to receivedAt: it already returned the
local arrival time used for sorting and day separators.
2026-10-11 01:37:36 -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
zjs81 11c94040e3 Add review mode with a simulated radio
Store reviewers have no MeshCore radio, so they could not reach any
screen past Connect or test the Android Auto messaging notifications.

- Long-press the "MeshCore Open" title on the Connect screen to enter
  review mode on any platform
- A simulated radio speaks the companion protocol as a fourth transport,
  so sync, messages, ACKs, notifications and notification replies run
  through the normal code paths
- Seeded contacts, channels and history; a new incoming message every
  45 s, auto-replies a few seconds after sending, and a banner with
  "Send test message" and "Exit"
- Review data uses its own fixed key scope and is cleared on entry, exit
  and at startup; the review scope never adopts legacy unscoped keys,
  and channel mutes changed during review are restored
- Code lives in lib/review_mode/ with tests in test/review_mode/
2026-10-07 20:38:59 -07: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 3c971705bd Fix QR contact import replay guard, type fallback and rescan loops
- Pass the existing contact's advert timestamp (0 for new contacts) so the
  firmware replay guard does not drop the node's real adverts.
- Leave a missing/invalid QR type unset and fall back to the existing
  contact's type instead of rewriting repeaters/rooms as Companion.
- Show a failed state with Retry instead of reopening the camera, which
  rescanned the same QR and resent the frame in a loop.
- Keep the processing flag set after a successful import so the closing
  route cannot restart the camera, import again and pop twice.
2026-09-27 12:04:05 -07:00
zjs81 fba97b9628 Merge remote-tracking branch 'origin/dev' into feat/contact-qr-import
# Conflicts:
#	untranslated.json
2026-09-27 12:02:42 -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 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
zjs81 8729bd571b Merge pull request #558 from M0Rf30/fix/gpx-export-desktop
Save GPX export via file dialog on desktop
2026-09-20 23:12:00 -07:00
Gianluca Boiano e169f7c639 Make pyx URL parsing tests hermetic
flutter_test blocks real HTTP, so the two pyx tests could never pass in CI.
Inject an overridable http.Client and drive them with MockClient.

(cherry picked from commit fb032ef0ee)
2026-09-17 23:15:29 +02:00
Gianluca Boiano fb032ef0ee Make pyx URL parsing tests hermetic
flutter_test blocks real HTTP, so the two pyx tests could never pass in CI.
Inject an overridable http.Client and drive them with MockClient.
2026-09-17 23:09:55 +02:00
Gianluca Boiano d0583f2039 Add contact import from QR code
Contacts could only be imported by pasting `meshcore://<hex advert>` from
the clipboard, so contact QR codes and links shared by the official app
(`meshcore://contact/add?name=...&public_key=...&type=...`) could not be
used at all.

Add a contact QR scanner screen, reachable from the contacts menu, that
scans with the camera or decodes a QR code from a photo in the gallery.
Both the official contact-card link and the existing hex advert form are
accepted; cards are applied with CMD_ADD_UPDATE_CONTACT and advert blobs
keep using CMD_IMPORT_CONTACT.

Fixes #529
2026-09-13 00:23:46 +02:00
hdhog d791570213 fix: use explicit time <epoch> for repeater clock sync
Companion firmware (MeshCore commit 4a869163, 2025-12-30) replaces the
CLI frame timestamp with the companion node's RTC for TXT_TYPE_CLI_DATA,
so "clock sync" sets the repeater clock to the node RTC. Nodes with a
wrong RTC push repeater clocks years into the future; firmware cannot
set the clock backwards without clkreboot.

- RepeaterCommandService: translate "clock sync" to "time <phone epoch>"
  before sending, matching official meshcore-cli behavior
- repeater login dialog: send "time <epoch>" for auto clock sync after
  login (this path bypasses RepeaterCommandService)
- add unit tests for the command translation

Ref: https://github.com/zjs81/meshcore-open/issues/464
2026-09-09 22:31:11 +04:00
ericz 4480c0d356 Merge remote-tracking branch 'zjs81/dev' into ez_disable_discoveredContact_eviction_PR 2026-09-08 18:09:32 +02:00
Seth Golub 74cd1128bc Support updated MeshCoreOne emoji reaction format
In #521, @Avi0n mentions they will be changing MeshCoreOne's reaction
format in the next release.

Here we add support for the new format, while retaining support for
the old format as "MC1Legacy".

There's some redundancy. My goal was not to maximize elegance, but
to facilitate easily tearing out support for the legacy format months
from now when we no longer care about it.

This has not been tested in the wild, as nothing is transmitting the
new format yet.
2026-09-07 09:56:24 -07:00
Seth Golub 9d3b4a40d9 Improvements to MeshCore-One emoji reaction processing
- Made Crockford-matching regex slighlty stricter (not allowing U)
- Match arbitrarily long multi-code-point joined emoji
- Added more validation checks for potential emoji, including that it's
  a single grapheme
- Added more unit tests for emoji parsing
- For reactions whose targets we can't find, display MC1-style
  reactions as normal messages. Continue old beavior of silently
  dropping unmatched MC-Open reactions.

Part of PR #537
2026-09-07 09:50:14 -07: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
ericz f9465cc4d0 android still failed, edit regex so that // in ipfs://cid are optional and ipfs:cid is also valid. 2026-08-28 21:38:01 +02:00
ericz 6786c3348f update zjs81/dev 724696cd3c and fix image preview position. 2026-08-11 20:30:14 +02:00