Skip to content

Commit

Permalink
Fix etag hanlding
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Feb 20, 2025
1 parent d76153e commit 575fcb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
[dependencies]
actix-cors = "0.7.0"
actix-http = "3.9.0"
actix-middleware-etag = "0.4.3"
actix-middleware-etag = "0.4.4"
actix-service = "2.0.2"
actix-web = { version = "4.9.0", features = ["rustls-0_23", "compress-zstd"] }
actix-web-lab = { version = "0.23.0" }
Expand Down
6 changes: 3 additions & 3 deletions server/src/client_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub async fn get_delta(
.and_then(|etag| etag.trim_matches('"').parse::<u32>().ok())
.unwrap_or(0);

let current_sdk_revision_id = 100; // TODO: Read from delta_manager
let current_sdk_revision_id = requested_revision_id + 1; // TODO: Read from delta_manager

match resolve_delta(
edge_token,
Expand All @@ -75,7 +75,7 @@ pub async fn get_delta(
.unwrap_or(current_sdk_revision_id);

HttpResponse::Ok()
.insert_header(("ETag", format!("\"{}\"", last_event_id)))
.insert_header(("ETag", format!("{}", last_event_id)))
.json(delta)
}
Some(Err(err)) => HttpResponse::InternalServerError().body(format!("Error: {:?}", err)),
Expand Down Expand Up @@ -226,7 +226,7 @@ async fn resolve_delta(
let delta_filter_set =
get_delta_filter(&edge_token, &token_cache, filter_query.clone()).ok()?;

let current_sdk_revision_id = 100; // TODO: get from delta manager
let current_sdk_revision_id = requested_revision_id + 1; // TODO: get from delta manager
if requested_revision_id >= current_sdk_revision_id {
return None;
}
Expand Down

0 comments on commit 575fcb1

Please # to comment.