feat: add set-as-my-location from map long-press, connector and UI #293
Conversation
…provements Add "Set as my location" option to the map long-press bottom sheet, allowing users to set their device position directly from the map. Includes connector, chat, contacts, and message retry service improvements.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71f59d23df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final queuesToSearch = targetContactKey != null | ||
| ? {targetContactKey: _pendingMessageQueuePerContact[targetContactKey]} | ||
| : _pendingMessageQueuePerContact; |
There was a problem hiding this comment.
Search all contact queues when hash fallback is needed
In updateMessageFromSent, the queue fallback now limits lookup to a single contact queue chosen from the first _activeMessages entry. If two contacts have in-flight sends and hash-based matching misses (the exact condition this fallback is meant to recover), a RESP_CODE_SENT for the other contact will return no match, so no _ackHashToMessageId mapping is recorded and the later send-confirm ACK cannot be correlated. This causes false retries/failed delivery tracking in concurrent chats.
Useful? React with 👍 / 👎.
| for (final id in contactIds) { | ||
| await _notifications.cancel(id: id.hashCode); |
There was a problem hiding this comment.
Separate advert cancellation IDs from message notification IDs
This advert-clear path cancels notifications by contactId.hashCode, but message notifications are also posted with contactId.hashCode in _showMessageNotificationImpl (and adverts use the same pattern in _showAdvertNotificationImpl). Because Contacts now calls this clear path on open, opening the Contacts screen can unintentionally clear active unread message notifications for the same contacts. Advert notifications need a distinct ID namespace so only advert toasts are removed.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91608ff09e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _activeMessages.add(messageId); | ||
| _attemptSend(messageId); | ||
| return; |
There was a problem hiding this comment.
Handle _attemptSend failures before marking message active
_sendNextForContact adds the message to _activeMessages and then fire-and-forgets _attemptSend, but _attemptSend awaits path callbacks that can throw (for example on transport/write failures). If that happens, _onMessageResolved is never reached, so the message stays active forever and later queued messages for that contact never get sent.
Useful? React with 👍 / 👎.
| await connector.refreshDeviceInfo(); | ||
| if (!mounted) return; | ||
| messenger.showSnackBar(SnackBar(content: Text(message))); |
There was a problem hiding this comment.
Avoid showing location-updated success when not connected
This handler always shows settings_locationUpdated after calling setNodeLocation/refreshDeviceInfo, but both connector methods are no-ops when disconnected. If the device is disconnected (or disconnects while the sheet is open), users get a false success message even though no location update was sent.
Useful? React with 👍 / 👎.
improvements
Add "Set as my location" option to the map long-press bottom sheet, allowing users to set their device position directly from the map. Includes connector, chat, contacts, and message retry service improvements.