-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
perfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization
Description
Description
The Footer component uses a recursive setTimeout pattern for the welcome message animation, but only tracks the most recent timeout ID in a single variable.
function tick() {
timeout = setTimeout(() => tick(), 5000) // Overwrites previous ID
}
let timeout = setTimeout(() => tick(), 10_000)
onCleanup(() => {
clearTimeout(timeout) // Only clears the LAST timeout
})When tick() schedules a new timeout, the previous timeout ID is lost before it can be cleared.
Impact
- Earlier timeouts continue to fire after component unmount
- Callbacks reference stale component state
- Closures prevent garbage collection
- Minor but cumulative memory leak
Location
packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx - lines 27-47
Related
Part of #3013 (general memory issues)
Metadata
Metadata
Assignees
Labels
perfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization