mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-03-28 17:43:05 +01:00
Fix out of order path WS broadcasts overwriting each other
This commit is contained in:
@@ -91,6 +91,10 @@ Specialized logic is delegated to hooks:
|
||||
- WebSocket: realtime deltas/events.
|
||||
- On WS connect, backend sends `health` only; contacts/channels still come from REST.
|
||||
|
||||
### New Message modal
|
||||
|
||||
`NewMessageModal` intentionally preserves form state (tab, inputs, checkboxes) when closed and reopened. The component instance persists across open/close cycles. This is by design so users don't lose in-progress input if they accidentally dismiss the dialog.
|
||||
|
||||
### Message behavior
|
||||
|
||||
- Outgoing sends are optimistic in UI and persisted server-side.
|
||||
|
||||
@@ -70,11 +70,13 @@ export function updateAck(messageId: number, ackCount: number, paths?: MessagePa
|
||||
for (const entry of cache.values()) {
|
||||
const idx = entry.messages.findIndex((m) => m.id === messageId);
|
||||
if (idx >= 0) {
|
||||
const current = entry.messages[idx];
|
||||
const updated = [...entry.messages];
|
||||
updated[idx] = {
|
||||
...entry.messages[idx],
|
||||
acked: ackCount,
|
||||
...(paths !== undefined && { paths }),
|
||||
...current,
|
||||
acked: Math.max(current.acked, ackCount),
|
||||
...(paths !== undefined &&
|
||||
paths.length >= (current.paths?.length ?? 0) && { paths }),
|
||||
};
|
||||
entry.messages = updated;
|
||||
return; // Message IDs are unique, stop after first match
|
||||
|
||||
Reference in New Issue
Block a user