Conversation
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>
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>
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>
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.
Summary
Fixes multiple issues including a panic when acknowledging incidents, sluggish keypresses, and re-escalation errors.
Bug Fixes
Nil Pointer Panic (Original Issue)
The code was dereferencing
*m.selectedIncidentin closures created before incident data was fetched. Refactored to create empty message structs and defer incident retrieval to Update() handlers.Re-escalation "Assignee cannot be empty" Error
ctrl+e(re-escalate) was failing with a 400 error. Fixed by:Viewport Consuming Navigation Keys
ESC and arrow keys were being consumed by the viewport. Fixed with
handledKeyflag to explicitly mark handled keys before passing to viewport.Performance Improvements
Priority Keypress Handling
All user keypresses now bypass the message queue for immediate processing, ensuring responsive UI even when async messages are queued.
Terminal Escape Sequence Filtering
Added comprehensive filtering of fake keypresses (OSC 11 color queries, CSI sequences, CPR cursor position reports) that were clogging the message queue and causing sluggishness.
Auto-Acknowledge Optimization
UserIsOnCall()result to reduce API calls from N to 1 per cycleTemplate Rendering Optimization
Eliminated triple rendering - now renders once on explicit request instead of auto-rendering on data arrival.
Code Quality
unAcknowledgedIncidentsMsgtype andreEscalateparameterPerformance Impact
Testing
🤖 Generated with Claude Code