Skip to content

Commit 8ac1b99

Browse files
committed
fix: pairing of messages
1 parent 85a166a commit 8ac1b99

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

frontend/src/components/common/PairedMessages.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div v-if="pairedMessages.length > 0" :class="containerClass">
33
<div :class="headerClass">
44
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">
5-
Paired {{ pairedMessages.length === 1 ? 'Message' : 'Messages' }} (same JSON-RPC ID)
5+
Paired {{ pairedMessages.length === 1 ? 'Message' : 'Messages' }} (same connection & ID)
66
</span>
77
</div>
88
<div :class="contentClass">
@@ -51,9 +51,20 @@ const pairedMessages = computed(() => {
5151
const parsed = JSON.parse(props.currentLog.message)
5252
if (!parsed.id) return []
5353
54-
// Find all messages with the same JSON-RPC ID, excluding the current one
54+
// Find all messages with the same JSON-RPC ID AND same connection endpoints
5555
return props.allLogs.filter(log => {
5656
if (log === props.currentLog) return false
57+
58+
// Check if it's the same connection (either direction)
59+
const sameConnection = (
60+
(log.src_ip === props.currentLog.src_ip && log.src_port === props.currentLog.src_port &&
61+
log.dst_ip === props.currentLog.dst_ip && log.dst_port === props.currentLog.dst_port) ||
62+
(log.src_ip === props.currentLog.dst_ip && log.src_port === props.currentLog.dst_port &&
63+
log.dst_ip === props.currentLog.src_ip && log.dst_port === props.currentLog.src_port)
64+
)
65+
66+
if (!sameConnection) return false
67+
5768
try {
5869
const otherParsed = JSON.parse(log.message)
5970
return otherParsed.id === parsed.id

0 commit comments

Comments
 (0)