-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Feat(dashboard): show the Betterstack incident title in the dashboard #3006
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
dc58c0f
Display the incident message and brighten the panel
samejr 6f6bfc3
Merge remote-tracking branch 'origin/main' into feat(webapp)-imrpoved…
samejr bcb2654
Adds missing custom focus state
samejr f9887cf
Merge branch 'main' into feat(webapp)-imrpoved-incident-notification
samejr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Stale closure over
fetcher.statein polling interval bypasses idle-guardThe
fetcher.state === "idle"check inside thesetIntervalcallback reads a stale value, making the guard ineffective.Root Cause
The
useEffectatresources.incidents.tsx:46has a dependency array of[isManagedCloud], but referencesfetcher.stateandfetcher.loadinside the interval callback. In Remix 2.x,useFetcher()returns a new object on each render with updatedstate/datavalues. Because the effect never re-runs after mount (unlessisManagedCloudchanges), thefetchercaptured in thesetIntervalclosure is the one from the initial render — wherefetcher.stateis permanently"idle".This means the guard
if (fetcher.state === "idle")on line 57 always evaluates totrue, sofetcher.loadis called every 60 seconds regardless of whether a previous request is still in flight. If a request happens to be in progress when the interval fires, callingload()again will abort the in-flight request and start a new one.The practical impact is limited because the 60-second interval is far longer than typical API response times, but the guard is functionally broken and could cause unnecessary request churn under slow network conditions.
Fix: Store
fetcher(orfetcher.state) in auseRefthat is updated each render, and read from the ref inside the interval callback. For example:Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.