chore: replace uuid with nanoid

This commit is contained in:
appflowy
2022-04-11 15:27:03 +08:00
parent f438898831
commit 82840e1201
33 changed files with 133 additions and 120 deletions

View File

@ -26,6 +26,7 @@ futures-util = "0.3.15"
thread-id = "3.3.0"
log = "0.4"
bytes = "1.0"
nanoid = "0.4.0"
[dev-dependencies]
quickcheck = "0.9.2"

View File

@ -14,7 +14,6 @@ use flowy_user::{
event_map::UserEvent::{InitUser, SignIn, SignOut, SignUp},
};
use lib_dispatch::prelude::{EventDispatcher, ModuleRequest, ToBytes};
use lib_infra::uuid;
use std::{fs, path::PathBuf, sync::Arc};
pub struct ViewTest {
@ -127,7 +126,7 @@ pub fn root_dir() -> String {
}
pub fn random_email() -> String {
format!("{}@appflowy.io", uuid())
format!("{}@appflowy.io", nanoid!(10))
}
pub fn login_email() -> String {

View File

@ -5,7 +5,7 @@ use crate::helper::*;
use flowy_net::{get_client_server_configuration, ClientServerConfiguration};
use flowy_sdk::{FlowySDK, FlowySDKConfig};
use flowy_user::entities::UserProfile;
use lib_infra::uuid;
use nanoid::nanoid;
pub mod prelude {
pub use crate::{event_builder::*, helper::*, *};
@ -36,7 +36,7 @@ impl std::default::Default for FlowySDKTest {
impl FlowySDKTest {
pub fn new(server_config: ClientServerConfiguration) -> Self {
let config = FlowySDKConfig::new(&root_dir(), server_config, &uuid()).log_filter("trace");
let config = FlowySDKConfig::new(&root_dir(), server_config, &nanoid!(6)).log_filter("trace");
let sdk = std::thread::spawn(|| FlowySDK::new(config)).join().unwrap();
std::mem::forget(sdk.dispatcher());
Self { inner: sdk }