question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Count option in sorting skips elements

See original GitHub issue

I use the following to show last 5 triggered automations:

type: 'custom:auto-entities'
card:
  type: entities
  title: "\U0001F916 Last triggered automations"
  state_color: false
  show_header_toggle: false
filter:
  include:
    - domain: automation
      options:
        secondary_info: last-triggered
  exclude: null
show_empty: false
unique: false
sort:
  method: last_triggered
  reverse: true
  count: 5

Unfortunately, this does miss or skip entities which definitely match the filter (double checked by logbook and developer tools). Made me think I´m nuts but finally I could track it down:

  • I tested with “domain: automation” and "entity_id: ‘automation.*’ but that makes no difference.
  • Also the created card does not make any difference (tested entities and logbook).
  • The missed elements are shown when count: 5 is removed or set to a high number, e. g. 100. Then it´s shown at the bottom end of the list.

Here you can see the missed one: grafik

I think there´s a bug with the count function. Unfortunately I can´t provide any more debug information.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thomaslovencommented, May 18, 2021

Try release 1.9.0

0reactions
bcuttercommented, May 22, 2021

Will test it on other places as well but think we´re good as v1.9.1 seems to have fixed this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is wrong in this sorting array skipping some elements?
You cannot only sort some items using the Array#sort() method - you either sort all or none. You don't define the position of...
Read more >
Counting Sort - GeeksforGeeks
Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct...
Read more >
Sorting results from SKIP, LIMIT, or FIRST queries - IBM
Queries that combine the SKIP and the FIRST or LIMIT options with the ORDER BY clause impose a unique order on the qualifying...
Read more >
Excel not sorting numbers correctly - smallest to largest etc.
When I filter or sort the numbers from smallest to largest there are numbers , in the 6200 to 6800 range, missing where...
Read more >
Skipping Records Last Updated September 2, 2022 - TechDocs
Use the STOPAFT option to stop sorting before the end of a file. · For example, to sort EMPLOY DATA A in alphabetical...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found