fix: panic when apply invalid update (#745)
This commit is contained in:
parent
1122031735
commit
d111282f7e
|
|
@ -53,14 +53,20 @@ impl Indexer for DocumentIndexer {
|
||||||
object_id: &str,
|
object_id: &str,
|
||||||
doc_state: Vec<u8>,
|
doc_state: Vec<u8>,
|
||||||
) -> Result<Option<AFCollabEmbeddings>, AppError> {
|
) -> Result<Option<AFCollabEmbeddings>, AppError> {
|
||||||
let collab = Collab::new_with_source(
|
let cloned_object_id = object_id.to_string();
|
||||||
CollabOrigin::Server,
|
let collab = tokio::spawn(async move {
|
||||||
object_id,
|
Collab::new_with_source(
|
||||||
DataSource::DocStateV1(doc_state),
|
CollabOrigin::Server,
|
||||||
vec![],
|
&cloned_object_id,
|
||||||
false,
|
DataSource::DocStateV1(doc_state),
|
||||||
)
|
vec![],
|
||||||
.map_err(|e| AppError::Internal(e.into()))?;
|
false,
|
||||||
|
)
|
||||||
|
.map_err(|e| AppError::Internal(e.into()))
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.map_err(|e| AppError::Internal(e.into()))??;
|
||||||
|
|
||||||
let document = Document::open(collab).map_err(|e| AppError::Internal(e.into()))?;
|
let document = Document::open(collab).map_err(|e| AppError::Internal(e.into()))?;
|
||||||
let mut params = match Self::get_document_contents(&document) {
|
let mut params = match Self::get_document_contents(&document) {
|
||||||
Ok(result) => result,
|
Ok(result) => result,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue