-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BUGFIX] When setting the Telemetry data in PUT /set_telemetry an invalid flight datetime query filter is used #117
base: master
Are you sure you want to change the base?
Conversation
start_datetime__gte=two_minutes_before_now, | ||
end_datetime__lte=five_hours_from_now, | ||
start_datetime__lte=now, | ||
end_datetime__gte=now, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @cyapa , I understand the bug but your query will catch any flight greater than now and less than now, should there not be additional filter e.g .one's that are currently declared or active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hrishiballal , you have that filter in place here: https://github.com/openutm/flight-blender/blob/master/flight_feed_operations/views.py#L326 to capture only flights in certain states. So I think we are okay to proceed with this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK no problems, the one bit remains, I can then merge this PR>
@@ -454,8 +452,7 @@ def set_telemetry(request): | |||
|
|||
unsigned_telemetry_observations.append(asdict(single_observation_set, dict_factory=NestedDict)) | |||
operation_id = f_details.id | |||
now = arrow.now().isoformat() | |||
relevant_operation_ids_qs = my_blender_database_reader.get_current_flight_declaration_ids(now=now) | |||
relevant_operation_ids_qs = my_blender_database_reader.get_current_flight_declaration_ids() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should have the ability to filter out based on the current time , so lets keep a variable in the method to enable filtering based on the current time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't now
always be a static value? If we make it an argument then now
can be assigned with any timestamp value in the past or future not the value for now. If we allow this then probably we change the name now to something else like, timestamp
etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now updated the field to have the timestamp, can you please recheck your PR?
Bug: When setting the telemetry, the query to retrieve active flights was set to
2 minutes before now - 5 hours after now
This will prevent the storing of telemetry because there can be active flights that are not started only2 minutes before
Fix: Changed the flight datetime query so that it fetches all flight plans that falls between
now
timeexample:
flight_starttime -> now <-flight_endtime