Skip to content
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

Newsfeed intervals become chaotic #2638

Closed
jalibu opened this issue Aug 29, 2021 · 46 comments
Closed

Newsfeed intervals become chaotic #2638

jalibu opened this issue Aug 29, 2021 · 46 comments

Comments

@jalibu
Copy link

jalibu commented Aug 29, 2021

I found a bug in MagicMirror

Platform: Raspberry Pi OS

Node Version: 14.17.2

MagicMirror Version: 2.16.0

Description: After an unspecified time, the newsfeed module starts with chaotic fading intervals. It looks like multiple, competing intervals are affecting fading at the same time. It is noticeable that there are fading pauses of different lengths.
A browser refresh fixes this problem temporary (as it refreshes client runtime intervals)

Screencast.mov

Steps to Reproduce: This problem is not reproducible "by hand", but comes by itself after an unpredictable runtime (without further human interactions)

Expected Results: Constant fading intervals

Actual Results: Fading intervals are totally messed up

Configuration:

{
  module: "newsfeed",
  position: "bottom_bar",
  config: {
    feeds: [
      {
        title: "Tagesschau.de",
        url: "https://www.tagesschau.de/xml/rss2"
      },
      {
        title: "Heidelberg.de",
        url: "https://www.heidelberg.de/site/Heidelberg_ROOT/pmrss/407657/Lde/pressemitteilungen.html"
      }
    ],
    showSourceTitle: true,
    showPublishDate: false,
    broadcastNewsFeeds: false,
    broadcastNewsUpdates: false,
    showDescription: true
  }
},

Additional Notes: -

@OberfragGER
Copy link

OberfragGER commented Aug 29, 2021

Here too.
It only happens with 2.16. WIth MM 2.15 no problem.

I also using MM_Pages to flip the page every 1 Minute. No special options in my config:

{
module: 'newsfeed',
position: 'top_bar',
header: '',
config: {
showDescription: false,
wrapDescription: false,
feeds: [
{
title: 'Spiegel Online Eilmeldungen',
url: 'https://www.spiegel.de/schlagzeilen/tops/index.rss'
},
{
title: 'Golem',
url: 'https://rss.golem.de/rss.php?feed=RSS2.0',
encoding: 'ISO-8859-1'
},
{
title: 'Heise',
url: 'https://www.heise.de/newsticker/heise-atom.xml'
},
{
title: 'Spiegel Online komlett',
url: 'https://www.spiegel.de/schlagzeilen/index.rss'
},
{
title: 'Computerbase',
url: 'https://www.computerbase.de/rss/news.xml'
},
{
title: 'Tagesschau',
url: 'http://www.tagesschau.de/xml/rss2'
}
]
}
},

@khassel
Copy link
Collaborator

khassel commented Aug 29, 2021

Already followed the corresponding Forum-Thread.

Reading through this thread I can summarize:

  • Problem exists since v2.16.0 (v2.15.0 is working correctly)
  • not related to setup (docker and pm2 was mentioned)
  • only occuring on the screen of the pi (not in remote browser using same pi instance)

Questions:

  • are there any foreign modules involved (MMM-Pages was mentioned by some users) or is it also occuring without foreign modules installed?
  • can someone test the develop branch because the electron version change to v13 (current is v11)?
  • are there any errors/warnings in the logs (on the pi and/or in the dev console)?

@jalibu
Copy link
Author

jalibu commented Aug 29, 2021

@khassel
Since the problem (as in my case) only occurs after several days of runtime, I have only been able to see it on my productive mirror, but not on my development environment.
I could not detect any errors in the Developer Console. However, since I don't keep an eye on the mirror 24/7, it is of course possible that the cause of the problem lies far back.

@MichMich
Copy link
Collaborator

I think the best thing to do is let someone who has this issue test the dev branch without any 3rd party modules. If this solves the issue, add the 3rd party modules to see if that was the issue. If not the issue seems to be solved by using the dev branch.

@Sekisback
Copy link

I think the best thing to do is let someone who has this issue test the dev branch without any 3rd party modules. If this solves the issue, add the 3rd party modules to see if that was the issue. If not the issue seems to be solved by using the dev branch.

Which file from the developer branch is the one I need to test?
with the exception of the PirModule my Mirror has no 3rd party Modules

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 5, 2021

@Sekisback you just do

git checkout develop

to get to the dev branch with the latest pre-release code

@rejas
Copy link
Collaborator

rejas commented Sep 5, 2021

@sdetweil shouldnt it be develop instead of dev?

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 5, 2021

@rejas doah!, fixed

@Sekisback
Copy link

on the way, develop branch installed, pm2 shows Version 2.17.0.
Cron job disabled. Now i have to wait till... till what??? the behavior occurred after days/weeks. Is there a way to force it.

@Sekisback
Copy link

good news, looks like that you made it, till now it works like expected

@OberfragGER
Copy link

When its going to be the 2,17 release? Think about tonswitch tonthe dev-branch.

@sdetweil
Copy link
Collaborator

October 1, release every 90 days

@Sekisback
Copy link

Bad news.. we were happy too early... not so wild as before, but a few news are shown like expected with the right time. But some of them rush

@khassel
Copy link
Collaborator

khassel commented Oct 1, 2021

New release v2.17.1 is released, so may some people can update and test if this issue is still present using the new version, thanks.

@Sekisback
Copy link

updated to 2.17.1, now we will see whats happen in the next few days

@OberfragGER
Copy link

OberfragGER commented Oct 4, 2021

Updated today to 2.17.
After a little time, every 2nd news is flashing. But the others seems to be stablem.
So its working by 50% now ;)

@radokristof
Copy link
Contributor

I have the same problem. Latest version installed, though the interval is chaotic, article disappears after 3-5sec, but updateInterval is set to 1min. Also some news are also flashing for me.

@traveller255
Copy link

I went back to version 2.14 for newsfeed, before nunjucks template, it is more stable and works properly

@MichMich
Copy link
Collaborator

What would be interesting is to test 2.14 but with the latest Electron version. Just to make sure it's not an issue of Electron.

@traveller255
Copy link

I don't use electron, I go into server mode and display in chrome Kiosk mode

@MichMich
Copy link
Collaborator

Hmmm that's interesting. How about everyone else with this issue? Using electron or server only?

Also: why chrome kiosk mode and not electron?

@Sekisback
Copy link

Using electron, runs without issues since the last update (7days)

@jalibu
Copy link
Author

jalibu commented Oct 10, 2021

I am using Electron with 2.17 and still had the problem.
Let me mention one thing: I added a new external WiFi Adapter to my system to improve the internet stability, as I had some connectivity issues (like timeouts etc). Since I did that, the problem did not occur again.

Perhaps the cause of the problem is near the error handling/retry mechanism?
This would also explain why the problem does not arise deterministically. Sometimes I had it after a few minutes, in other cases only after several days of runtime.

@MichMich
Copy link
Collaborator

What's the update interval you are using?

@jalibu
Copy link
Author

jalibu commented Oct 10, 2021

Default values. Here is my config:

{
  module: "newsfeed",
  position: "bottom_bar",
  config: {
    feeds: [
      {
        title: "Tagesschau.de",
        url: "https://www.tagesschau.de/xml/rss2"
      },
      {
        title: "Heidelberg.de",
        url: "https://www.heidelberg.de/site/Heidelberg_ROOT/pmrss/407657/Lde/pressemitteilungen.html"
      }
    ],
    showSourceTitle: true,
    showPublishDate: false,
    broadcastNewsFeeds: false,
    broadcastNewsUpdates: false,
    showDescription: true
  }
},

@traveller255
Copy link

Hmmm that's interesting. How about everyone else with this issue? Using electron or server only?

Also: why chrome kiosk mode and not electron?

I am running a modified version on windows, on several devices and it seems simpler to me

@MichMich
Copy link
Collaborator

@hangorazvan makes sense.

@MichMich
Copy link
Collaborator

@jalibu hmmm that's using the default value of 5 min. That's way long enough to not conflict with timed out requests.

@jalibu
Copy link
Author

jalibu commented Oct 10, 2021

I thought about this change: 37fab7a#diff-ff5384d40bfcc5aeb84bf47c5652e5569f09ab0c2aa35486de39712451c5c396

It recalls scheduleUpdateInterval

@jalibu jalibu closed this as completed Oct 10, 2021
@jalibu jalibu reopened this Oct 10, 2021
@radokristof
Copy link
Contributor

@MichMich I'm using the "standard" way, with Electron, installed on an RPi, now UpdateInterval set to 1min, previously it was only 20secs or something... Either way I have this problem.

@Sekisback
Copy link

after 11 days without trouble, same behavior as before. with the difference, that the news stay a little bit longer may 3second

@radokristof
Copy link
Contributor

Installed dev version, same as before. After some time, the updateInterval is not normal.

@jalibu
Copy link
Author

jalibu commented Oct 17, 2021

I found a way to reproduce the problem:

  1. Set the reloadInterval short (to simplify testing, eg. 30 * 1000)
  2. Start MM -> Works fine
  3. Unplug network connection -> Module will display error when it tries to reload newsfeeds
  4. Connect to the Internet again
  5. Module will fetch newsfeeds and will render again but with chaotic fading intervals

Tested with Chrome on MacOS. No Electron

@jalibu
Copy link
Author

jalibu commented Oct 17, 2021

You could also just use the Browser console and execute once:

MM.getModules()[0].socketNotificationReceived("NEWSFEED_ERROR", {error_type: 'MODULE_ERROR_UNSPECIFIED'})

where getModules()[0] is the id of the newsfeed module

@jalibu
Copy link
Author

jalibu commented Oct 17, 2021

Update: Or even simpler,

just execute MM.getModules()[0].scheduleUpdateInterval() like the module does, after an error has occurred

@rejas
Copy link
Collaborator

rejas commented Oct 17, 2021

Thanks for the hints @jalibu I might have found the issue behind it. Please check out my PR..

@sdetweil
Copy link
Collaborator

I found a way to reproduce the problem:

  1. Set the reloadInterval short (to simplify testing, eg. 30 * 1000)
  2. Start MM -> Works fine
  3. Unplug network connection -> Module will display error when it tries to reload newsfeeds
  4. Connect to the Internet again
  5. Module will fetch newsfeeds and will render again but with chaotic fading intervals

Tested with Chrome on MacOS. No Electron

yes. 'bug in error handler'

else if (notification === "NEWSFEED_ERROR") {
			this.error = this.translate(payload.error_type);
			this.scheduleUpdateInterval();
		}

force starts another IntervalTimer()

so now you have two, or three or ... after however many errors..

@sdetweil
Copy link
Collaborator

Thanks for the hints @jalibu I might have found the issue behind it. Please check out my PR..

i don't see any open PR's

@rejas
Copy link
Collaborator

rejas commented Oct 17, 2021

Thanks for the hints @jalibu I might have found the issue behind it. Please check out my PR..

i don't see any open PR's

Give an old man some time :-D

@jalibu
Copy link
Author

jalibu commented Oct 17, 2021

Like I said 7 days ago ;-)

@rejas
Copy link
Collaborator

rejas commented Oct 17, 2021

Like I said 7 days ago ;-)

Didnt have the time to look at the whole thread these days :-)

@MichMich
Copy link
Collaborator

🎉

@jalibu
Copy link
Author

jalibu commented Oct 17, 2021

Haha, I opened a PR, too. But you @rejas were first.
It seems I will never make it into the desired MagicMirror Contributors Hall of Fame ¯_(ツ)_/¯ :-D

@MichMich
Copy link
Collaborator

Haha. One day ....

@rejas
Copy link
Collaborator

rejas commented Oct 17, 2021

I created another PR for this ;-)

@MichMich
Copy link
Collaborator

Thanks for this important contribution. 😬👍🏻

@jalibu jalibu closed this as completed Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants