diff --git a/packages/simplex-chat-nodejs/src/api.ts b/packages/simplex-chat-nodejs/src/api.ts index 0d3339df9a..386752b80d 100644 --- a/packages/simplex-chat-nodejs/src/api.ts +++ b/packages/simplex-chat-nodejs/src/api.ts @@ -688,7 +688,7 @@ export class ChatApi { * Network usage: interactive. */ async apiConnectPlan(userId: number, connectionLink: string): Promise<[T.ConnectionPlan, T.CreatedConnLink]> { - const r = await this.sendChatCmd(CC.APIConnectPlan.cmdString({userId, connectionLink, resolveKnown: false})) + const r = await this.sendChatCmd(CC.APIConnectPlan.cmdString({userId, connectTarget: connectionLink, resolveMode: T.PlanResolveMode.Unknown})) if (r.type === "connectionPlan") return [r.connectionPlan, r.connLink] throw new ChatCommandError("error getting connect plan", r) } @@ -707,7 +707,7 @@ export class ChatApi { * Network usage: interactive. */ async apiConnectActiveUser(connLink: string): Promise { - const r = await this.sendChatCmd(CC.Connect.cmdString({incognito: false, connLink_: connLink})) + const r = await this.sendChatCmd(CC.Connect.cmdString({incognito: false, connTarget_: connLink})) return this.handleConnectResult(r) } @@ -866,7 +866,7 @@ export class ChatApi { * Network usage: no. */ async apiCreateActiveUser(profile?: T.Profile): Promise { - const r = await this.sendChatCmd(CC.CreateActiveUser.cmdString({newUser: {profile, pastTimestamp: false, userChatRelay: false}})) + const r = await this.sendChatCmd(CC.CreateActiveUser.cmdString({newUser: {profile, pastTimestamp: false, userChatRelay: false, clientService: false}})) if (r.type === "activeUser") return r.user throw new ChatCommandError("unexpected response", r) } diff --git a/packages/simplex-chat-python/src/simplex_chat/api.py b/packages/simplex-chat-python/src/simplex_chat/api.py index ef37e28384..f1a1853293 100644 --- a/packages/simplex-chat-python/src/simplex_chat/api.py +++ b/packages/simplex-chat-python/src/simplex_chat/api.py @@ -466,7 +466,7 @@ class ChatApi: ) -> tuple[T.ConnectionPlan, T.CreatedConnLink]: r = await self.send_chat_cmd( CC.APIConnectPlan_cmd_string( - {"userId": user_id, "connectionLink": connection_link, "resolveKnown": False} + {"userId": user_id, "connectTarget": connection_link, "resolveMode": "unknown"} ) ) if r["type"] == "connectionPlan": @@ -487,7 +487,7 @@ class ChatApi: async def api_connect_active_user(self, conn_link: str) -> ConnReqType: r = await self.send_chat_cmd( - CC.Connect_cmd_string({"incognito": False, "connLink_": conn_link}) + CC.Connect_cmd_string({"incognito": False, "connTarget_": conn_link}) ) return self._handle_connect_result(r) @@ -641,7 +641,7 @@ class ChatApi: raise async def api_create_active_user(self, profile: T.Profile | None = None) -> T.User: - new_user: T.NewUser = {"pastTimestamp": False, "userChatRelay": False} + new_user: T.NewUser = {"pastTimestamp": False, "userChatRelay": False, "clientService": False} if profile is not None: new_user["profile"] = profile r = await self.send_chat_cmd(CC.CreateActiveUser_cmd_string({"newUser": new_user})) diff --git a/packages/simplex-chat-python/tests/test_native_cache.py b/packages/simplex-chat-python/tests/test_native_cache.py index 30a1f43e2a..55084eeae8 100644 --- a/packages/simplex-chat-python/tests/test_native_cache.py +++ b/packages/simplex-chat-python/tests/test_native_cache.py @@ -4,6 +4,7 @@ from pathlib import Path import pytest from simplex_chat._native import _cache_root, _resolve_libs_dir, _download +from simplex_chat._version import LIBS_VERSION def test_cache_root_linux(tmp_path, monkeypatch): @@ -41,7 +42,7 @@ def test_resolve_downloads_when_missing(tmp_path, monkeypatch): monkeypatch.setattr("simplex_chat._native._download", fake_download) libs_dir = _resolve_libs_dir("sqlite") - assert libs_dir == tmp_path / "simplex-chat" / "v6.5.2" / "sqlite" + assert libs_dir == tmp_path / "simplex-chat" / f"v{LIBS_VERSION}" / "sqlite" assert called["backend"] == "sqlite" assert (libs_dir / "libsimplex.so").exists() @@ -49,7 +50,7 @@ def test_resolve_downloads_when_missing(tmp_path, monkeypatch): def test_resolve_uses_cache_on_second_call(tmp_path, monkeypatch): monkeypatch.setenv("XDG_CACHE_HOME", str(tmp_path)) monkeypatch.setattr("sys.platform", "linux") - cached = tmp_path / "simplex-chat" / "v6.5.2" / "sqlite" + cached = tmp_path / "simplex-chat" / f"v{LIBS_VERSION}" / "sqlite" cached.mkdir(parents=True) (cached / "libsimplex.so").touch() # Should NOT call _download — use the cached file. diff --git a/packages/simplex-chat-python/tests/test_native_url.py b/packages/simplex-chat-python/tests/test_native_url.py index b27c3e09cf..df96fff8ae 100644 --- a/packages/simplex-chat-python/tests/test_native_url.py +++ b/packages/simplex-chat-python/tests/test_native_url.py @@ -1,6 +1,7 @@ from unittest.mock import patch import pytest from simplex_chat._native import _platform_tag, _libs_url, _libname +from simplex_chat._version import LIBS_VERSION @patch("sys.platform", "linux") @@ -42,7 +43,7 @@ def test_url_sqlite(_): assert ( _libs_url("sqlite") == "https://github.com/simplex-chat/simplex-chat-libs/releases/download/" - "v6.5.2/simplex-chat-libs-linux-x86_64.zip" + f"v{LIBS_VERSION}/simplex-chat-libs-linux-x86_64.zip" ) @@ -51,5 +52,5 @@ def test_url_postgres(_): assert ( _libs_url("postgres") == "https://github.com/simplex-chat/simplex-chat-libs/releases/download/" - "v6.5.2/simplex-chat-libs-linux-x86_64-postgres.zip" + f"v{LIBS_VERSION}/simplex-chat-libs-linux-x86_64-postgres.zip" )