Skip to content

Fixes issue 4243: Ensure while loop in calendar module does not get stuck when no entries - #4244

Merged
khassel merged 2 commits into
MagicMirrorOrg:developfrom
deBasMan21:patch-1
Sep 9, 2026
Merged

Fixes issue 4243: Ensure while loop in calendar module does not get stuck when no entries#4244
khassel merged 2 commits into
MagicMirrorOrg:developfrom
deBasMan21:patch-1

Conversation

@deBasMan21

Copy link
Copy Markdown

Fixes: #4243

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Thanks. But please base your pull requests against the develop branch.

@khassel
khassel force-pushed the patch-1 branch 5 times, most recently from abb9177 to 7a4901b Compare September 4, 2026 22:40
@khassel
khassel changed the base branch from master to develop September 4, 2026 22:40
@khassel

khassel commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@KristjanESPERANTO I was able to switch this to develop

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@deBasMan21 I haven’t looked deeply into this yet, but could moving daysCollected++ outside the if affect how limitDays is intended to work?

@sdetweil

sdetweil commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Yes, that was why it was counted inside the loop

@deBasMan21

deBasMan21 commented Sep 7, 2026

Copy link
Copy Markdown
Author

@khassel thanks for switching it to develop!

@KristjanESPERANTO It should actually not really affect the limitDays functionality. It was counted inside the loop for n amount of days to collect calendar items from. However when a day has no items it would keep being stuck in the loop so no more items would be added. With this change the calendar items for the next n days would still be collected, but when there is a day without any items nothing would break. So when you set limitDays to 5 for example, it would still only collect the items from the next 5 days. I hope i explained this clear enough, but otherwise let me know ofcourse!

@KristjanESPERANTO KristjanESPERANTO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, that makes sense to me now. Would you also like to add a regression test for this? No problem if not :)

@deBasMan21

Copy link
Copy Markdown
Author

I would love to, but currently im a bit short on time so maybe i will add one later on.

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

I wrote a test. Without your fix, it fails; with your fix, it passes. So, as far as I'm concerned, the PR is ready to be merged :)

@khassel
khassel merged commit 1761bcc into MagicMirrorOrg:develop Sep 9, 2026
13 checks passed
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

Successfully merging this pull request may close these issues.

[Bug] All items not loading when calendar loading fails

4 participants