Skip to content

Commit

Permalink
bug: Add proper update_user logic for Bigtable (#503)
Browse files Browse the repository at this point in the history
Closes: SYNC-3982
  • Loading branch information
jrconlin authored Jan 11, 2024
1 parent 8c99f47 commit 89c3bd9
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
audit:
docker:
# NOTE: update version for all # RUST_VER
- image: rust:1.73
- image: rust:1.74
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml
FROM rust:1.73-buster as builder
FROM rust:1.74-buster as builder
ARG CRATE

ADD . /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ impl UnidentifiedClient {
if let Some(mut user) = self.app_state.db.get_user(&uaid).await? {
if let Some(flags) = process_existing_user(&self.app_state, &user).await? {
user.node_id = Some(self.app_state.router_url.to_owned());
if user.connected_at > connected_at {
let _ = self.app_state.metrics.incr("ua.already_connected");
return Err(SMErrorKind::AlreadyConnected.into());
}
user.connected_at = connected_at;
user.set_last_connect();
if !self.app_state.db.update_user(&user).await? {
Expand Down
Loading

0 comments on commit 89c3bd9

Please sign in to comment.