Skip to content

Commit 85d8ab5

Browse files
committed
test: verify terminal stream delivery and lock dependencies
1 parent 80c439a commit 85d8ab5

8 files changed

Lines changed: 415 additions & 68 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: dtolnay/rust-toolchain@stable
1717
- uses: Swatinem/rust-cache@v2
18-
- name: Resolve WebSocket dependencies
19-
run: |
20-
cargo update --workspace
21-
python3 -c 'import json,pathlib; print("GFA_LOCK_JSON:"+json.dumps({"path":"Cargo.lock","content":pathlib.Path("Cargo.lock").read_text()}))'
2218
- name: Prepare SQLite schema for query checking
2319
run: python3 .github/scripts/sqlite-query-check.py prepare
2420
env:

‎Cargo.lock‎

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

‎crates/adapters/gfa-http/src/lib.rs‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,19 @@ pub fn local_router(service: Arc<GameService>, address: SocketAddr) -> Result<Ro
4343
///
4444
/// The host must install this same LiveUpdates instance with GameService::with_observer.
4545
/// Periodic reconciliation also catches commits from other hosts sharing the store.
46-
pub fn local_router_with_updates(service: Arc<GameService>, address: SocketAddr, updates: Arc<LiveUpdates>) -> Result<Router, ApiError> {
46+
pub fn local_router_with_updates(
47+
service: Arc<GameService>,
48+
address: SocketAddr,
49+
updates: Arc<LiveUpdates>,
50+
) -> Result<Router, ApiError> {
4751
build_router(service, address, Some(updates))
4852
}
4953

50-
fn build_router(service: Arc<GameService>, address: SocketAddr, updates: Option<Arc<LiveUpdates>>) -> Result<Router, ApiError> {
54+
fn build_router(
55+
service: Arc<GameService>,
56+
address: SocketAddr,
57+
updates: Option<Arc<LiveUpdates>>,
58+
) -> Result<Router, ApiError> {
5159
if !address.ip().is_loopback() || address.port() == 0 {
5260
return Err(ApiError::new(
5361
"INVALID_CONFIG",
@@ -67,9 +75,13 @@ fn build_router(service: Arc<GameService>, address: SocketAddr, updates: Option<
6775
.fallback(not_found)
6876
.method_not_allowed_fallback(method_not_allowed);
6977
if let Some(updates) = updates {
70-
router = router.route("/v1/matches/{id}/stream", get(stream::upgrade).layer(axum::Extension(updates)));
78+
router = router.route(
79+
"/v1/matches/{id}/stream",
80+
get(stream::upgrade).layer(axum::Extension(updates)),
81+
);
7182
}
72-
Ok(router.layer(DefaultBodyLimit::max(MAX_BODY_BYTES))
83+
Ok(router
84+
.layer(DefaultBodyLimit::max(MAX_BODY_BYTES))
7385
.layer(middleware::from_fn_with_state(
7486
access::LocalAccess::new(address),
7587
access::guard,

0 commit comments

Comments
 (0)