Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/tapmap/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ def _build_open_port(self, conn: dict[str, Any], *, proto: str) -> OpenPort | No
local_address = self._format_local_address(l_ip, l_port)

process_status = conn.get("process_status") or "Unavailable"
# Raw OS process name if available.
process_name = conn.get("process_name") or None
exe = conn.get("exe") or None

# User-facing display label with fallback semantics.
if process_name:
process_label = process_name
elif process_status == "No process":
Expand Down Expand Up @@ -305,6 +307,10 @@ def _build_remote_endpoint_item(self, conn: dict[str, Any], *, proto: str) -> Ca
"lat": lat_value,
"lon": lon_value,
"pid": conn.get("pid"),
# CacheItem.process_name intentionally stores the display-oriented
# process label, not the raw backend process name. Cache items are
# used for UI aggregation, grouping, and summaries where fallback
# labels such as "System" are required.
"process_name": conn.get("process_label"),
"exe": conn.get("exe"),
"cmdline": conn.get("cmdline"),
Expand Down
6 changes: 2 additions & 4 deletions src/tapmap/ui/modal_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,8 @@ def _render_lan_local(cls, snapshot: Any | None) -> list[Any]:
cleaned: list[dict[str, Any]] = [r for r in rows if isinstance(r, dict)]

def is_established_tcp(row: dict[str, Any]) -> bool:
state = row.get("state")
if isinstance(state, str) and state.strip() and state.strip().upper() != "ESTABLISHED":
return False

# CacheItem rows only contain ESTABLISHED TCP or remote UDP endpoints.
# The model pre-filters all other TCP states, so no explicit state check is needed here.
proto = row.get("proto")
return not (isinstance(proto, str) and proto.strip() and proto.strip().lower() != "tcp")

Expand Down
Loading