Skip to content

Commit a8638c6

Browse files
committed
fix: restore sync_max_count check in sync_conversations method
1 parent 26b3ec7 commit a8638c6

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

crates/restsend-wasm/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-wasm"
3-
version = "1.2.5"
3+
version = "1.2.6"
44
edition = "2021"
55
description = "Restsend Instant Messaging Javascript/Wasm SDK"
66
authors = ["Restsend Team <[email protected]>"]

crates/restsend/src/client/conversation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,6 @@ impl Client {
240240
if let Some(cb) = store_ref.callback.read().unwrap().as_ref() {
241241
cb.on_conversations_updated(r.items);
242242
}
243-
if sync_max_count > 0 && conversations.len() as u32 >= sync_max_count {
244-
break;
245-
}
246243
if !r.has_more {
247244
break;
248245
}
@@ -318,6 +315,9 @@ impl Client {
318315
if !lr.has_more {
319316
break;
320317
}
318+
if sync_max_count > 0 && conversations.len() as u32 >= sync_max_count {
319+
break;
320+
}
321321
}
322322
Err(e) => {
323323
warn!("sync_conversations failed: {:?}", e);

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"Restsend Team <[email protected]>"
66
],
77
"description": "Restsend Instant Messaging Javascript/Wasm SDK",
8-
"version": "1.2.5",
8+
"version": "1.2.6",
99
"files": [
1010
"restsend_wasm_bg.wasm",
1111
"restsend_wasm.js",

js/restsend_wasm.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ export interface InitOutput {
855855
readonly __wbindgen_export_4: WebAssembly.Table;
856856
readonly __wbindgen_export_5: WebAssembly.Table;
857857
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
858-
readonly closure586_externref_shim: (a: number, b: number, c: any) => void;
859-
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1fabe8d991285aa3: (a: number, b: number) => void;
858+
readonly closure587_externref_shim: (a: number, b: number, c: any) => void;
859+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e2c558bb5b847c5: (a: number, b: number) => void;
860860
readonly closure847_externref_shim: (a: number, b: number, c: any) => void;
861861
readonly closure888_externref_shim: (a: number, b: number, c: any, d: any) => void;
862862
readonly __wbindgen_start: () => void;

js/restsend_wasm.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ export function setLogging(level) {
287287
}
288288

289289
function __wbg_adapter_54(arg0, arg1, arg2) {
290-
wasm.closure586_externref_shim(arg0, arg1, arg2);
290+
wasm.closure587_externref_shim(arg0, arg1, arg2);
291291
}
292292

293293
function __wbg_adapter_59(arg0, arg1) {
294-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1fabe8d991285aa3(arg0, arg1);
294+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e2c558bb5b847c5(arg0, arg1);
295295
}
296296

297297
function __wbg_adapter_66(arg0, arg1, arg2) {
@@ -2557,23 +2557,23 @@ function __wbg_get_imports() {
25572557
return ret;
25582558
};
25592559
imports.wbg.__wbindgen_closure_wrapper1127 = function(arg0, arg1, arg2) {
2560-
const ret = makeMutClosure(arg0, arg1, 587, __wbg_adapter_54);
2560+
const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_54);
25612561
return ret;
25622562
};
25632563
imports.wbg.__wbindgen_closure_wrapper1128 = function(arg0, arg1, arg2) {
2564-
const ret = makeMutClosure(arg0, arg1, 587, __wbg_adapter_54);
2564+
const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_54);
25652565
return ret;
25662566
};
25672567
imports.wbg.__wbindgen_closure_wrapper1129 = function(arg0, arg1, arg2) {
2568-
const ret = makeMutClosure(arg0, arg1, 587, __wbg_adapter_59);
2568+
const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_59);
25692569
return ret;
25702570
};
2571-
imports.wbg.__wbindgen_closure_wrapper1132 = function(arg0, arg1, arg2) {
2572-
const ret = makeMutClosure(arg0, arg1, 587, __wbg_adapter_54);
2571+
imports.wbg.__wbindgen_closure_wrapper1130 = function(arg0, arg1, arg2) {
2572+
const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_54);
25732573
return ret;
25742574
};
2575-
imports.wbg.__wbindgen_closure_wrapper1135 = function(arg0, arg1, arg2) {
2576-
const ret = makeMutClosure(arg0, arg1, 587, __wbg_adapter_54);
2575+
imports.wbg.__wbindgen_closure_wrapper1132 = function(arg0, arg1, arg2) {
2576+
const ret = makeMutClosure(arg0, arg1, 588, __wbg_adapter_54);
25772577
return ret;
25782578
};
25792579
imports.wbg.__wbindgen_closure_wrapper2284 = function(arg0, arg1, arg2) {

js/restsend_wasm_bg.wasm

33 Bytes
Binary file not shown.

js/restsend_wasm_bg.wasm.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export const __externref_table_alloc: () => number;
104104
export const __wbindgen_export_4: WebAssembly.Table;
105105
export const __wbindgen_export_5: WebAssembly.Table;
106106
export const __wbindgen_free: (a: number, b: number, c: number) => void;
107-
export const closure586_externref_shim: (a: number, b: number, c: any) => void;
108-
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1fabe8d991285aa3: (a: number, b: number) => void;
107+
export const closure587_externref_shim: (a: number, b: number, c: any) => void;
108+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e2c558bb5b847c5: (a: number, b: number) => void;
109109
export const closure847_externref_shim: (a: number, b: number, c: any) => void;
110110
export const closure888_externref_shim: (a: number, b: number, c: any, d: any) => void;
111111
export const __wbindgen_start: () => void;

0 commit comments

Comments
 (0)