mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
fix(tui): ignore stale github pr lookup state
Leave the current GitHub PR pending flag untouched when an async lookup result arrives for an old cwd. This prevents late stale events from allowing duplicate lookups for the active status surface cwd.
This commit is contained in:
@@ -1935,7 +1935,6 @@ impl ChatWidget {
|
||||
pull_request: Option<GithubPullRequest>,
|
||||
) {
|
||||
if self.status_line_github_pr_cwd.as_ref() != Some(&cwd) {
|
||||
self.status_line_github_pr_pending = false;
|
||||
return;
|
||||
}
|
||||
self.status_line_github_pr = pull_request;
|
||||
|
||||
@@ -948,6 +948,17 @@ async fn github_pr_state_resets_when_no_surface_uses_it() {
|
||||
assert!(!chat.status_line_github_pr_lookup_complete);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn stale_github_pr_update_preserves_current_pending_lookup() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.status_line_github_pr_cwd = Some(PathBuf::from("/repo/current"));
|
||||
chat.status_line_github_pr_pending = true;
|
||||
|
||||
chat.set_status_line_github_pr(PathBuf::from("/repo/old"), None);
|
||||
|
||||
assert!(chat.status_line_github_pr_pending);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn status_line_branch_refreshes_after_turn_complete() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
|
||||
Reference in New Issue
Block a user