Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes nasa/fprime#3086. Default to insertion order for chrono hist #184

Merged
merged 2 commits into from
Dec 19, 2024
Merged
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
4 changes: 3 additions & 1 deletion src/fprime_gds/common/history/chrono.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def __insert_chrono(data_object, ordered):
the index that the item was inserted at (int)
"""
for i, item in reversed(list(enumerate(ordered))):
if item.get_time() < data_object.get_time():
# Note: for events with the exact same time, this should default to the order received from downlink
# and as such the data item should be treated as newer because it was received later.
if item.get_time() <= data_object.get_time():
ordered.insert(i + 1, data_object)
return i
# If the data object is the earliest in the list or the list was empty
Expand Down
Loading