The php-debugbar shows messages in random order
Hello,
The php-debugbar shows messages in random order. I can see in the browser the following logs
[3] 21.535 Report: Running ...:
[0] 21.535 Report: skipped
[2] 21.535 Report: Replaced ...
[1] 21.535 Report: Limit has been set
[5] 21.598 Report: Setting limit
[4] 21.598 Report: Query returned data
While the index in square brackets is incremented and on the server I can see in logs which is how I expect the debugbar to behave also:
[0] 21.535 Report: skipped
[1] 21.535 Report: Limit has been set
[2] 21.535 Report: Replaced ...
[3] 21.535 Report: Running ...:
[4] 21.598 Report: Query returned data
[5] 21.598 Report: Setting limit
Are you using the default MessageCollector? It should sort the array on time when sending to the debugbar. Otherwise we could perhaps sort the messages on time in the widget?
how Fix it ?

` $debugbar = new StandardDebugBar(); $debugbarRenderer = $debugbar ->getJavascriptRenderer(); $debugbar->addCollector(new MessagesCollector('Files')); $files = get_included_files();
foreach ($files as $key => $filename)
{
$sort += 1;
$debugbar["Files"]->addMessage($sort. ' :' . $filename , 'File');
}
`
echo $debugbarRenderer->renderHead() echo $debugbarRenderer->render()
Why the final array needs resorting since messages are appended already in order using addMessage() ?
Do we have any fix for this issue?