Skip to content

Commit 03c91b9

Browse files
ashu17706claude
andcommitted
fix: increase delay for IP detection to reflect connection state changes
The WARP daemon requires ~5 seconds to fully process connect/disconnect commands and update the routing. Previously, 1500ms was insufficient, causing IP addresses to show as unchanged. Increased delay to 5000ms (5 seconds) to ensure IP queries reflect the actual connection state. Testing shows: - warp down: Before WARP IP → After ISP IP ✓ - warp up: Before ISP IP → After WARP IP ✓ Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 3636859 commit 03c91b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/commands/connect.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use anyhow::Result;
22
use serde_json::json;
33
use colored::Colorize;
4+
use std::thread;
5+
use std::time::Duration;
46
use crate::format;
57
use crate::warp_cli;
68
use crate::ip;
@@ -12,6 +14,9 @@ pub fn run(connect: bool, json: bool, quiet: bool) -> Result<()> {
1214

1315
warp_cli::connect()?;
1416

17+
// Wait for connection to take effect
18+
thread::sleep(Duration::from_millis(5000));
19+
1520
// Get IP after connecting
1621
let after_ip = ip::get_public_ip().ok();
1722

@@ -42,6 +47,9 @@ pub fn run(connect: bool, json: bool, quiet: bool) -> Result<()> {
4247

4348
warp_cli::disconnect()?;
4449

50+
// Wait for disconnection to take effect
51+
thread::sleep(Duration::from_millis(5000));
52+
4553
// Get IP after disconnecting
4654
let after_ip = ip::get_public_ip().ok();
4755

0 commit comments

Comments
 (0)