test(e2e): browse a firewalled peer via the server broker
Add an e2e that forces the server-brokered (firewalled) browse path —
the path that matters on the real network. The sharer does NOT listen,
so the browser's direct dial fails and the server must broker the peer
connecting back to the browser's listener. This exercises
PeerConnectFailed -> ConnectToPeer -> inbound PierceFirewall ->
PeerConnected flush, which the localhost direct-dial test never hits.
Also soften user-facing download failure reasons from protocol jargon
("Peer …") to plain language ("The user went offline", etc.).
This commit is contained in:
@@ -1174,9 +1174,9 @@ impl Client {
|
||||
|
||||
if failed {
|
||||
let reason = if peer_registered {
|
||||
"Peer rejected the download request"
|
||||
"The user declined the download"
|
||||
} else {
|
||||
"Could not connect to the peer"
|
||||
"Could not connect to the user"
|
||||
};
|
||||
let _ = download
|
||||
.sender
|
||||
@@ -1213,7 +1213,7 @@ impl Client {
|
||||
.map(|d| (d.token, d.sender.clone()))
|
||||
.collect();
|
||||
for (token, sender) in doomed {
|
||||
let reason = Some("Peer disconnected".to_string());
|
||||
let reason = Some("The user went offline".to_string());
|
||||
let _ = sender.send(DownloadStatus::Failed(reason.clone()));
|
||||
context.update_download_with_status(
|
||||
token,
|
||||
@@ -1274,7 +1274,7 @@ impl Client {
|
||||
context.downloads.update_status(
|
||||
token,
|
||||
DownloadStatus::Failed(Some(
|
||||
"Peer reported the upload failed".to_string(),
|
||||
"The upload failed on the other side".to_string(),
|
||||
)),
|
||||
);
|
||||
context.downloads.remove(token);
|
||||
|
||||
@@ -150,7 +150,7 @@ pub fn collect_failed_tokens(
|
||||
})
|
||||
.map(|d| {
|
||||
let _ = d.sender.send(DownloadStatus::Failed(Some(
|
||||
"Peer reported the upload failed".to_string(),
|
||||
"The upload failed on the other side".to_string(),
|
||||
)));
|
||||
d.token
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user