Skip to content

Time gap check references wrong message index #2

@NotYuSheng

Description

@NotYuSheng

Problem

In format_conversations (scripts/telegram_extract.py, line 61), the time gap is computed as:

time_diff = int(next_msg["date_unixtime"]) - int(messages[j - 1]["date_unixtime"])

messages[j - 1] is the previous index in the full message list, not the previous message in your response chain. If there are skipped non-message entries (e.g. service events) between positions j-1 and j, the time diff is measured against the wrong message, potentially breaking a valid chain or allowing an invalid one.

Expected behavior

The time gap should be measured against the last successfully added response message, not the raw previous list index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions