Skip to content

Commit 107f27d

Browse files
authored
* fix: patch dependency * chore: update `Cargo.lock` * chore: add an integration test for forced redirects for specifiers
1 parent c8fc7ac commit 107f27d

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

Cargo.lock

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ http = "0.2"
8181
faster-hex = "0.9.0"
8282
tracing = "0.1"
8383

84-
# DEBUG
85-
# [patch.crates-io]
86-
# deno_core = { path = "/Users/andrespirela/Documents/workspace/supabase/deno_core/core" }
84+
[patch.crates-io]
85+
# TODO(Nyannyacha): Patch below is temporary. Clean the line in the Deno 1.44 update.
86+
deno_core = { git = "https://github.com/supabase/deno_core", branch = "278-supabase" }
8787

8888
[profile.dind]
8989
inherits = "dev"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// NOTE(Nyannyacha): This is the same test case as described in denoland/deno_core#762, but it is a
2+
// minimal reproducible sample of what happens in the field.
3+
//
4+
// `@1.x` suffixes cause forced redirects for specifiers.
5+
6+
import * as A from "https://lib.deno.dev/x/[email protected]/mod.ts";
7+
import * as B from "https://lib.deno.dev/x/[email protected]/types.ts";
8+
9+
console.log(A, B);
10+
11+
Deno.serve((_req) => new Response("meow"));

crates/base/tests/integration_tests.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,31 @@ async fn test_request_idle_timeout_websocket_node_secure() {
20742074
test_request_idle_timeout_websocket_deno(new_localhost_tls(true), true).await;
20752075
}
20762076

2077+
#[tokio::test]
2078+
#[serial]
2079+
async fn test_should_not_hang_when_forced_redirection_for_specifiers() {
2080+
let (tx, rx) = oneshot::channel::<()>();
2081+
2082+
integration_test!(
2083+
"./test_cases/main",
2084+
NON_SECURE_PORT,
2085+
"concurrent-redirect",
2086+
None,
2087+
None,
2088+
None,
2089+
None,
2090+
(|resp| async {
2091+
assert_eq!(resp.unwrap().status().as_u16(), 200);
2092+
tx.send(()).unwrap();
2093+
}),
2094+
TerminationToken::new()
2095+
);
2096+
2097+
if timeout(Duration::from_secs(10), rx).await.is_err() {
2098+
panic!("failed to check within 10 seconds");
2099+
}
2100+
}
2101+
20772102
trait AsyncReadWrite: AsyncRead + AsyncWrite + Send + Unpin {}
20782103

20792104
impl<T> AsyncReadWrite for T where T: AsyncRead + AsyncWrite + Send + Unpin {}

0 commit comments

Comments
 (0)