feat: Add debounce to the notification on data-lake list update#2379
Merged
rafaellehmkuhl merged 1 commit intobluerobotics:masterfrom Jan 28, 2026
Conversation
ArturoManzoli
requested changes
Jan 28, 2026
src/libs/actions/data-lake.ts
Outdated
|
|
||
| // Debounce timer for variable info change notifications | ||
| let notifyInfoListenersTimeout: ReturnType<typeof setTimeout> | null = null | ||
| const NOTIFY_INFO_DEBOUNCE_MS = 1000 |
Contributor
There was a problem hiding this comment.
This variable name should be in camelCase
Those listening to updates in the data-lake variables list need to know it updated, and which are the new values, but when hundreds of values are being added at once, which happens during startup and during vehicle connection, they don't need to be updated hundreds of times. This update makes it so the listeners are notified only if no updates are made to the list for at least 1 second. Reduces from 40 to 2 notifications per Plotter, and from 40 to 2 notifications per VeryGenericIndicator.
83a6bb4 to
906f56f
Compare
ArturoManzoli
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Those listening to updates in the data-lake variables list need to know it updated, and which are the new values, but when hundreds of values are being added at once (which happens during startup and vehicle connection) they don't need to be updated hundreds of times.
This update makes it so the listeners are notified only if no updates are made to the list for at least 1 second.
Reduces from 40 to 2 notifications per Plotter, and from 40 to 2 notifications per VeryGenericIndicator.
In my default profile/view (5 Plotters and 2 VGIs) it reduced the number of updates from 280 to 14.