Commit d4b4e15
Fix panic, performance issues, and re-escalation bug (#133)
* Fix nil pointer dereference panic when acknowledging incidents
Resolves panic that occurred when trying to acknowledge incidents by
removing unsafe dereferences of m.selectedIncident in message handler
closures. The closures were capturing the incident pointer at creation
time, which could be nil, rather than at execution time when the
incident data is guaranteed to be available.
Changes:
- Modified acknowledge/unacknowledge message handlers to create empty
message structs instead of dereferencing m.selectedIncident in closures
- Updated Update() function handlers to safely retrieve incident from
model state when processing messages
- Added nil check in silence incidents handler to prevent panic when
appending selected incident
The fix ensures that incident data is accessed only after it has been
fetched from PagerDuty and stored in the model, preventing nil pointer
dereferences.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix performance issues and re-escalation bug
Multiple performance and functionality improvements:
- Fix re-escalation "Assignee cannot be empty" error by skipping
unnecessary un-acknowledge step and going directly to re-escalation
with proper user email authentication
- Add comprehensive terminal escape sequence filtering to prevent fake
keypresses from clogging the message queue (OSC, CSI, CPR responses)
- Implement priority handling for all user keypresses to ensure
responsive UI even when async messages are queued
- Optimize auto-acknowledge feature with early return when disabled
and cached on-call check to reduce API calls from N to 1 per cycle
- Remove triple template rendering - now renders once on explicit request
- Fix viewport consuming ESC and navigation keys with handledKey flag
- Add debug logging to track re-escalation flow
- Clean up unused code: remove unAcknowledgedIncidentsMsg and
reEscalate parameter from acknowledgeIncidents()
Performance impact:
- ESC/Enter keys now respond immediately instead of waiting for queued messages
- Auto-acknowledge overhead reduced to near-zero when feature is disabled
- Eliminated redundant template renders (3x → 1x per incident view)
Fixes: https://github.com/clcollins/srepd/issues/XXX
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix ineffectual handledKey assignments flagged by linter
Remove ineffectual assignments to handledKey in cases that immediately
return. These assignments had no effect since the function returns
before reaching the handledKey check at line 414.
Fixes linter errors:
- pkg/tui/msgHandlers.go: ineffectual assignment to handledKey (ineffassign)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9bdf567 commit d4b4e15
0 file changed
0 commit comments