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

Fix infinite loop on the alerter #363

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Jun 28, 2023

Fix #364

@@ -14,7 +14,7 @@
class="expanded-alerts-bar absolute w-full p-2 transition-all rounded top-12 max-h-[30vh] overflow-y-auto text-slate-50 scrollbar-hide bg-slate-800/75 select-none flex flex-col"
:class="{ 'opacity-0 invisible': !isShowingExpandedAlerts }"
>
<div v-for="(alert, i) in alertStore.sortedAlerts.reverse()" :key="alert.time_created.toISOString()">
<div v-for="(alert, i) in [...alertStore.sortedAlerts].reverse()" :key="alert.time_created.toISOString()">
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to have a comment explaining the copy to avoid someone cleaning the code and adding the bug back.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do that.

Reverting it in place causes an infinite mutation loop in the list (and crashes the app).
@rafaellehmkuhl rafaellehmkuhl changed the title Crash fix Fix infinite loop on the alerter Jun 28, 2023
@rafaellehmkuhl rafaellehmkuhl merged commit 8aa916e into bluerobotics:master Jun 28, 2023
@rafaellehmkuhl rafaellehmkuhl deleted the crash-fix branch June 28, 2023 18:52
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.

Cockpit v.0.2.0 is crashing on startup
2 participants