home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.73k forks source link

Feedreader sends events in reverse order #126272

Open GsakuL opened 1 month ago

GsakuL commented 1 month ago

The problem

when adding a new feed, or a feed gets multiple updates in the checking interval, the events (which I use for notifications) of new entries appear to be sent/created consistently in reverse order, because I'll receive the newest one first, then n-1, n-2 etc.

What version of Home Assistant Core has the issue?

core-2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Feedreader

Link to integration documentation on our website

https://www.home-assistant.io/integrations/feedreader/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

repro:

exerpt from event data (listed as seen in the ui - newer events on top)

event_type: feedreader
data:
  id: tag:github.com,2008:Repository/38982731/20240806.0
  guidislink: true
  link: https://github.com/home-assistant/frontend/releases/tag/20240806.0
  updated: "2024-08-06T10:36:24Z"
...
time_fired: "2024-09-19T15:33:28.801904+00:00"
event_type: feedreader
data:
  id: tag:github.com,2008:Repository/38982731/20240806.1
  guidislink: true
  link: https://github.com/home-assistant/frontend/releases/tag/20240806.1
  updated: "2024-08-06T15:19:42Z"
...
time_fired: "2024-09-19T15:33:28.801850+00:00"
event_type: feedreader
data:
  id: tag:github.com,2008:Repository/38982731/20240809.0
  guidislink: true
  link: https://github.com/home-assistant/frontend/releases/tag/20240809.0
  updated: "2024-08-09T18:25:43Z"
...
time_fired: "2024-09-19T15:33:28.801783+00:00"
home-assistant[bot] commented 1 month ago

Hey there @mib1185, mind taking a look at this issue as it has been labeled with an integration (feedreader) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `feedreader` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign feedreader` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


feedreader documentation feedreader source (message by IssueLinks)

mib1185 commented 1 month ago

Hi @GsakuL the feeds are read in order as they come and most feeds put the latest entry on the top of the feed

GsakuL commented 1 month ago

Hi @mib1185 so you mean, you read the response like a stream, and not as a whole file? But why is that? And if "most feeds put the latest on the top", why not "do it right", and also hold on to the necessary events and send/publish them in the "correct" (latest entries last) order?

Due to the hard 1h interval since the migration from yaml, this "wrong order problem" happens more often, which is annoying, when the entries are then written to somewhere else (e.g. Discord)

mib1185 commented 1 month ago

Due to the hard 1h interval since the migration from yaml

You're still able to use a custom polling interval to adjust it on your needs.

mib1185 commented 1 month ago

btw. the behavior of reading the feed from top to down hasn't changed with migrating to UI based configuration