zed: Fix session ID mismatching for workspace and telemetry (#43659)
I don't think this caused any problems for us but you never know ... Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -3,7 +3,6 @@ use std::time::Duration;
|
||||
use db::kvp::KEY_VALUE_STORE;
|
||||
use gpui::{App, AppContext as _, Context, Subscription, Task, WindowId};
|
||||
use util::ResultExt;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Session {
|
||||
session_id: String,
|
||||
@@ -15,11 +14,9 @@ const SESSION_ID_KEY: &str = "session_id";
|
||||
const SESSION_WINDOW_STACK_KEY: &str = "session_window_stack";
|
||||
|
||||
impl Session {
|
||||
pub async fn new() -> Self {
|
||||
pub async fn new(session_id: String) -> Self {
|
||||
let old_session_id = KEY_VALUE_STORE.read_kvp(SESSION_ID_KEY).ok().flatten();
|
||||
|
||||
let session_id = Uuid::new_v4().to_string();
|
||||
|
||||
KEY_VALUE_STORE
|
||||
.write_kvp(SESSION_ID_KEY.to_string(), session_id.clone())
|
||||
.await
|
||||
@@ -43,10 +40,10 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
// #[cfg(any(test, feature = "test-support"))]
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
pub fn test() -> Self {
|
||||
Self {
|
||||
session_id: Uuid::new_v4().to_string(),
|
||||
session_id: uuid::Uuid::new_v4().to_string(),
|
||||
old_session_id: None,
|
||||
old_window_ids: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user