fix: synchronization issue due to incorrect collab origin (#1054)

This commit is contained in:
Khor Shu Heng 2024-12-09 14:19:00 +08:00 committed by GitHub
parent 955a60d14a
commit 29cb70a362
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 17 deletions

View File

@ -431,13 +431,8 @@ async fn handle_message(
// send one ack back to the client.
if ack_response.is_none() {
ack_response = Some(
CollabAck::new(
message_origin.clone(),
object_id.to_string(),
msg_id,
seq_num,
)
.with_payload(payload.unwrap_or_default()),
CollabAck::new(CollabOrigin::Server, object_id.to_string(), msg_id, seq_num)
.with_payload(payload.unwrap_or_default()),
);
}
},
@ -453,14 +448,9 @@ async fn handle_message(
};
ack_response = Some(
CollabAck::new(
message_origin.clone(),
object_id.to_string(),
msg_id,
seq_num,
)
.with_code(code)
.with_payload(payload),
CollabAck::new(CollabOrigin::Server, object_id.to_string(), msg_id, seq_num)
.with_code(code)
.with_payload(payload),
);
break;

View File

@ -44,7 +44,6 @@ use redis::{AsyncCommands, RedisResult, Value};
use database::pg_row::AFImportTask;
use serde::{Deserialize, Serialize};
use serde_json::from_str;
use sqlx::types::chrono;
use sqlx::types::chrono::{DateTime, TimeZone, Utc};
use sqlx::PgPool;
use std::collections::{HashMap, HashSet};
@ -912,7 +911,6 @@ async fn process_unzip_file(
let mut collab_params_list = vec![];
let mut database_view_ids_by_database_id: HashMap<String, Vec<String>> = HashMap::new();
let mut orphan_view_ids = HashSet::new();
let timestamp = chrono::Utc::now().timestamp();
// 3. Collect all collabs and resources
let mut stream = imported.into_collab_stream().await;