Skip to content

Commit c5d85ce

Browse files
committed
Update version to 1.1.6, enhance non-blocking behavior in conversation updates.
1 parent 15c4e5e commit c5d85ce

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed

crates/restsend-wasm/src/conversations.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ impl Client {
5454
let ensureConversationVersion =
5555
js_sys::Reflect::get(&option, &JsValue::from_str("ensureConversationVersion"))
5656
.ok()
57-
.map(|v| v.as_bool().unwrap_or(true));
58-
57+
.map(|v| v.as_bool().unwrap_or(false));
58+
5959
self.inner
6060
.sync_chat_logs(
6161
topicId,
@@ -66,8 +66,8 @@ impl Client {
6666
)
6767
.await
6868
}
69-
70-
pub async fn saveChatLogs(&self, logs:JsValue) -> Result<(), JsValue> {
69+
70+
pub async fn saveChatLogs(&self, logs: JsValue) -> Result<(), JsValue> {
7171
let logs = serde_wasm_bindgen::from_value::<Vec<restsend_sdk::models::ChatLog>>(logs)?;
7272
self.inner.save_chat_logs(&logs).await.map_err(|e| e.into())
7373
}
@@ -200,14 +200,10 @@ impl Client {
200200
/// Clear conversation on local storage
201201
/// #Arguments
202202
/// * `topicId` - topic id
203-
pub async fn clearConversation(
204-
&self,
205-
topicId: String,
206-
){
203+
pub async fn clearConversation(&self, topicId: String) {
207204
self.inner.clear_conversation(topicId).await.ok();
208205
}
209206

210-
211207
/// Set conversation extra
212208
/// #Arguments
213209
/// * `topicId` - topic id

crates/restsend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "restsend-sdk"
3-
version = "1.1.5"
3+
version = "1.1.6"
44
edition = "2021"
55

66
[lib]

crates/restsend/src/client/conversation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Client {
134134
.get_conversation(
135135
&topic_id,
136136
false,
137-
ensure_conversation_last_version.unwrap_or(true),
137+
ensure_conversation_last_version.unwrap_or(false),
138138
)
139139
.await
140140
.unwrap_or_default();

crates/restsend/src/client/store/conversations.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ impl ClientStore {
506506
return;
507507
}
508508
};
509+
if !blocking {
510+
// return if not blocking, just update local conversation
511+
return;
512+
}
509513
if let Some(cb) = callback.read().unwrap().as_ref() {
510514
cb.on_conversations_updated(vec![c]);
511515
};

js/restsend_wasm.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,10 @@ export interface InitOutput {
847847
readonly __wbindgen_export_4: WebAssembly.Table;
848848
readonly __wbindgen_export_5: WebAssembly.Table;
849849
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
850-
readonly closure587_externref_shim: (a: number, b: number, c: any) => void;
851-
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he238d3f82a9875d9: (a: number, b: number) => void;
852-
readonly closure839_externref_shim: (a: number, b: number, c: any) => void;
853-
readonly closure880_externref_shim: (a: number, b: number, c: any, d: any) => void;
850+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h18c4b70474f535e4: (a: number, b: number) => void;
851+
readonly closure588_externref_shim: (a: number, b: number, c: any) => void;
852+
readonly closure840_externref_shim: (a: number, b: number, c: any) => void;
853+
readonly closure881_externref_shim: (a: number, b: number, c: any, d: any) => void;
854854
readonly __wbindgen_start: () => void;
855855
}
856856

js/restsend_wasm.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,20 @@ export function logout(endpoint, token) {
270270
return ret;
271271
}
272272

273-
function __wbg_adapter_54(arg0, arg1, arg2) {
274-
wasm.closure587_externref_shim(arg0, arg1, arg2);
273+
function __wbg_adapter_54(arg0, arg1) {
274+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h18c4b70474f535e4(arg0, arg1);
275275
}
276276

277-
function __wbg_adapter_57(arg0, arg1) {
278-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he238d3f82a9875d9(arg0, arg1);
277+
function __wbg_adapter_57(arg0, arg1, arg2) {
278+
wasm.closure588_externref_shim(arg0, arg1, arg2);
279279
}
280280

281281
function __wbg_adapter_66(arg0, arg1, arg2) {
282-
wasm.closure839_externref_shim(arg0, arg1, arg2);
282+
wasm.closure840_externref_shim(arg0, arg1, arg2);
283283
}
284284

285285
function __wbg_adapter_439(arg0, arg1, arg2, arg3) {
286-
wasm.closure880_externref_shim(arg0, arg1, arg2, arg3);
286+
wasm.closure881_externref_shim(arg0, arg1, arg2, arg3);
287287
}
288288

289289
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -2328,7 +2328,7 @@ function __wbg_get_imports() {
23282328
imports.wbg.__wbg_setRequestHeader_51d371ad5196f6ef = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
23292329
arg0.setRequestHeader(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
23302330
}, arguments) };
2331-
imports.wbg.__wbg_setTimeout_ec4d2ae203c942d7 = function(arg0, arg1) {
2331+
imports.wbg.__wbg_setTimeout_691d6252a6327657 = function(arg0, arg1) {
23322332
setTimeout(arg0, arg1 >>> 0);
23332333
};
23342334
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
@@ -2532,27 +2532,27 @@ function __wbg_get_imports() {
25322532
return ret;
25332533
};
25342534
imports.wbg.__wbindgen_closure_wrapper1162 = function(arg0, arg1, arg2) {
2535-
const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_54);
2535+
const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_54);
25362536
return ret;
25372537
};
25382538
imports.wbg.__wbindgen_closure_wrapper1163 = function(arg0, arg1, arg2) {
2539-
const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_57);
2539+
const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_57);
25402540
return ret;
25412541
};
25422542
imports.wbg.__wbindgen_closure_wrapper1164 = function(arg0, arg1, arg2) {
2543-
const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_54);
2543+
const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_57);
25442544
return ret;
25452545
};
25462546
imports.wbg.__wbindgen_closure_wrapper1166 = function(arg0, arg1, arg2) {
2547-
const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_54);
2547+
const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_57);
25482548
return ret;
25492549
};
2550-
imports.wbg.__wbindgen_closure_wrapper1169 = function(arg0, arg1, arg2) {
2551-
const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_54);
2550+
imports.wbg.__wbindgen_closure_wrapper1170 = function(arg0, arg1, arg2) {
2551+
const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_57);
25522552
return ret;
25532553
};
25542554
imports.wbg.__wbindgen_closure_wrapper2265 = function(arg0, arg1, arg2) {
2555-
const ret = makeMutClosure(arg0, arg1, 840, __wbg_adapter_66);
2555+
const ret = makeMutClosure(arg0, arg1, 841, __wbg_adapter_66);
25562556
return ret;
25572557
};
25582558
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {

js/restsend_wasm_bg.wasm

385 Bytes
Binary file not shown.

js/restsend_wasm_bg.wasm.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export const __externref_table_alloc: () => number;
102102
export const __wbindgen_export_4: WebAssembly.Table;
103103
export const __wbindgen_export_5: WebAssembly.Table;
104104
export const __wbindgen_free: (a: number, b: number, c: number) => void;
105-
export const closure587_externref_shim: (a: number, b: number, c: any) => void;
106-
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he238d3f82a9875d9: (a: number, b: number) => void;
107-
export const closure839_externref_shim: (a: number, b: number, c: any) => void;
108-
export const closure880_externref_shim: (a: number, b: number, c: any, d: any) => void;
105+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h18c4b70474f535e4: (a: number, b: number) => void;
106+
export const closure588_externref_shim: (a: number, b: number, c: any) => void;
107+
export const closure840_externref_shim: (a: number, b: number, c: any) => void;
108+
export const closure881_externref_shim: (a: number, b: number, c: any, d: any) => void;
109109
export const __wbindgen_start: () => void;

0 commit comments

Comments
 (0)