Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Nov 17, 2023
1 parent edc5d2b commit b578c83
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Ensure you have Docker Compose installed on your host server. Follow the officia

## Steps

> **🚀Note for AWS Users:** [Here](./EC2_SELF_HOST_GUIDE) is a step by step guide to self host AppFlowy Cloud on AWS EC2. Skip it if you are not using AWS.
> **🚀Note for AWS Users:** [Here](./EC2_SELF_HOST_GUIDE.md) is a step by step guide to self host AppFlowy Cloud on AWS EC2. Skip it if you are not using AWS.

### 1. Getting source files
Expand Down
4 changes: 3 additions & 1 deletion libs/client-api/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use tokio::io::AsyncReadExt;
use tokio_retry::strategy::FixedInterval;
use tokio_retry::RetryIf;
use tokio_tungstenite::tungstenite::Message;
use tracing::{event, instrument};
use tracing::{event, instrument, trace};
use url::Url;

use crate::retry::{RefreshTokenAction, RefreshTokenRetryCondition};
Expand Down Expand Up @@ -1024,6 +1024,7 @@ impl Client {
.into_data()
}

#[instrument(level = "debug", skip_all, err)]
async fn http_client_with_auth(
&self,
method: Method,
Expand All @@ -1042,6 +1043,7 @@ impl Client {
}

let access_token = self.access_token()?;
trace!("start request: {}, method: {}", url, method);
let request_builder = self
.cloud_client
.request(method, url)
Expand Down
16 changes: 16 additions & 0 deletions tests/user/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use client_api::ws::{WSClient, WSClientConfig};
use serde_json::json;
use shared_entity::dto::auth_dto::{UpdateUserParams, UserMetaData};
use std::time::Duration;
use uuid::Uuid;

#[tokio::test]
async fn update_but_not_logged_in() {
Expand Down Expand Up @@ -76,6 +77,21 @@ async fn update_user_name() {
assert_eq!(profile.name.unwrap().as_str(), "lucas");
}

#[tokio::test]
async fn update_user_email() {
let (c, user) = generate_unique_registered_user_client().await;
c.sign_in_password(&user.email, &user.password)
.await
.unwrap();

let new_email = format!("{}@appflowy.io", Uuid::new_v4().to_string());
c.update_user(UpdateUserParams::new().with_email(new_email.clone()))
.await
.unwrap();

let profile = c.get_profile().await.unwrap();
assert_eq!(profile.email.unwrap().as_str(), &new_email);
}
#[tokio::test]
async fn update_user_metadata() {
let (c, user) = generate_unique_registered_user_client().await;
Expand Down

0 comments on commit b578c83

Please sign in to comment.