Skip to content

Dev roomserver fixes#27

Merged
zjs81 merged 7 commits into
mainfrom
dev-roomserver-fixes
Jan 11, 2026
Merged

Dev roomserver fixes#27
zjs81 merged 7 commits into
mainfrom
dev-roomserver-fixes

Conversation

@zjs81

@zjs81 zjs81 commented Jan 11, 2026

Copy link
Copy Markdown
Owner

Based on #24


Note

Introduces Room support across parsing, persistence, UI, and navigation.

  • Parses contact messages to capture the first 4 bytes of the sender key (fourByteRoomContactKey) and attaches it to Message; trims 4-byte prefix when rendering Room messages; differentiates notifications for chat vs room
  • Persists fourByteRoomContactKey in MessageStore (save/load) and exposes it via Message.copyWith
  • Chat UI resolves Room message sender by 4-byte prefix, shows sender name with [HEX], opens message path with resolved contact, and adds “Open Chat” action for Room messages
  • Adds RoomLoginDialog and wires Room login into Contacts and Map flows (open/login room, then navigate to chat)

Written by Cursor Bugbot for commit 8c3ffa5. This will update automatically on new commits. Configure here.

@zjs81 zjs81 merged commit 310818f into main Jan 11, 2026
1 check passed
@zjs81 zjs81 deleted the dev-roomserver-fixes branch January 11, 2026 18:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on February 10

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

} else if (contact?.type == advTypeRoom) {
_notificationService.showMessageNotification(
contactName: contact?.name ?? 'Unknown Room',
message: message.text.substring(4),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing bounds check causes crash on short messages

High Severity

The notification for room messages calls message.text.substring(4) without checking if the text is at least 4 characters long. This will throw a RangeError when a room message has fewer than 4 characters. The equivalent code in chat_screen.dart at line 939 correctly uses message.text.substring(4.clamp(0, message.text.length)) to prevent this crash.

Fix in Cursor Fix in Web


if (frame.length <= baseTextOffset) return null;

final fourBytePubMSG = frame.sublist(baseTextOffset, baseTextOffset + 4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insufficient frame length check causes sublist crash

High Severity

The bounds check at line 2038 only verifies frame.length > baseTextOffset, but line 2039 attempts to extract 4 bytes with frame.sublist(baseTextOffset, baseTextOffset + 4). This requires frame.length >= baseTextOffset + 4. When a frame has between baseTextOffset + 1 and baseTextOffset + 3 bytes, the sublist call will throw a RangeError, crashing message parsing.

Fix in Cursor Fix in Web

Surfbee3 added a commit to Surfbee3/meshcore-open that referenced this pull request Jun 25, 2026
flserial open asserts DTR (setDTR(true)); on boards with the stock 100nF
DTR-reset cap (Seeed Wio-E5 / STM32WL on a USB-UART bridge) that edge reboots
the MCU, and the device-query handshake then races the ~1.2-1.9s boot and times
out. Wait 2500ms before returning so the board is ready. Harmless on boards that
don't reset on DTR; well inside the upstream 5s command timeouts. Sibling to the
meshcore.js DTR->RST fix (PR zjs81#27).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants