Skip to content

Commit 1674c48

Browse files
committed
Fix timestamp serialization for run action
As far as I remember, the timestamp is not really used in the frontend (but in the backend). Still, it should be fixed to provide correct data and avoid confusion.
1 parent b28da39 commit 1674c48

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/submissions_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,11 @@ def send_and_store(client_socket, message)
415415
end
416416
@testrun[:messages].push message
417417
@testrun[:status] = message[:status] if message[:status]
418-
client_socket&.send_data(message.to_json)
418+
419+
# Workaround for the undesired serialization of ActiveSupport::Duration (just `to_i` rather than `to_f`)
420+
message_serialized = message.dup
421+
message_serialized[:timestamp] = message_serialized[:timestamp].to_f
422+
client_socket&.send_data(message_serialized.to_json)
419423
end
420424

421425
def max_output_buffer_size

0 commit comments

Comments
 (0)