Commit Graph
2196 Commits
Author SHA1 Message Date
Evgeny @ SimpleX Chat 46e7b39560 smp server: plan with SUB and SEND sequences before and after the change 2026-10-31 21:58:44 +00:00
Evgeny @ SimpleX Chat b0f5b17ac6 smp server: send the first message once when SEND delivers it during SUB 2026-10-31 13:20:52 +00:00
Evgeny @ SimpleX Chat 62ae7f10c8 Merge branch 'master' of https://github.com/simplex-chat/simplexmq into ep/smp-sub-register-first
# Conflicts:
#	tests/ServerTests.hs
2026-10-30 22:30:19 +00:00
Evgeny @ SimpleX Chat aa471cd570 smp server: deliver later messages after SUB while a delivery waits (#2006)
* smp server: deliver later messages after SUB while a delivery waits

* smp server: reset delivery thread state only for the subscribed client
2026-10-30 22:29:16 +00:00
Evgeny @ SimpleX Chat 97bccbc681 smp server: remove do and mask_ from subscribeNewQueue 2026-10-30 20:03:34 +00:00
Evgeny @ SimpleX Chat 768eb69a00 tests: sign SUB with authTransmission, keep test helpers unchanged 2026-10-30 19:45:35 +00:00
Evgeny @ SimpleX Chat 7e98ccac30 smp server: name server subscribers srvSubs in runClient 2026-10-30 19:45:35 +00:00
Evgeny @ SimpleX Chat cc60502a49 smp server: register subscription of a new queue directly 2026-10-30 19:45:21 +00:00
Evgeny @ SimpleX Chat 88570938a2 tests: receive SUB and SEND responses in order 2026-10-30 19:25:10 +00:00
Evgeny @ SimpleX Chat 3402d75905 smp server: keep subscriber registration in smpServer, pass it to client 2026-10-30 19:25:10 +00:00
Evgeny @ SimpleX Chat b6b5db8bb0 smp server: deliver messages sent while the recipient subscribes 2026-10-30 19:01:17 +00:00
Evgeny @ SimpleX Chat e010205e1e smp server: move subscriber registration out of serverThread 2026-10-30 18:58:51 +00:00
Evgeny @ SimpleX Chat 59bf55b27a tests: reproduce SUB and SEND race in one block 2026-10-30 18:56:52 +00:00
Evgeny Poberezkin d1f97d38f7 7.1.0.15 2026-10-30 06:46:13 +00:00
brenzi-agentandbrenzi-agent 89c8ba9c98 resolver: read .simplex reservations from the name policy (#1993)
* resolver: read .simplex reservations from the name policy

simplex-network/ens-contracts#42 moved reservedNames from SimplexController
to SimplexNamePolicy. SNRC_NAME_POLICY_<TLD> names it; where it is unset the
controller is read as before, as on .testing.

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: keep the reserved read's shape, explicit policy in tests, describe contracts by behavior

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: pin the name policy in every test that reads reservations, one policy test that fails without the read, note setNamePolicy

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: no env pins the suite does not keep elsewhere, no comment repeating the docstring

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: name what the .testing controller keeps

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: an empty name policy reply is refused too

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: read each controller's name policy at startup in place of SNRC_NAME_POLICY_<TLD>

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: workers open their own RPC connections, docs of the startup read, test names and docstrings that say what holds

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: a controller with no contract behind it stops the startup read, so the container restarts until the node reaches it

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: an empty name policy reply falls back again, so a chain without .testing's controller still starts; new functions after the ones they join, compose lines added only

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: tests of the workers' own connections, an address without a contract and an unconfigured controller; docs of which TLDs answer 502

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: a controller naming no policy is logged as the other fallbacks are, a test of the startup exit, no redundant default

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: the startup test above the worker tests' Linux guard, without a controller it does not need

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: the startup test runs one worker, a test of an unconfigured controller, the fallbacks described once

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: compose names the 502 of a policy the node has not reached, the worker test sets its own reservation, no repeated README clauses

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: every worker test reads the name's reservation from the policy, so its answer stays in setUp

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: docstrings that say where reservations are read from, no comment that does not hold

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: each reservation read picks the policy over the controller itself, no helper for two sites

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

* resolver: address review: the quick start's restart for a TLD with a name policy, the startup read's docstring

Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F

---------

Co-authored-by: brenzi-agent <346870783+brenzi-agent@users.noreply.github.com>
2026-10-29 12:13:37 +00:00
Evgeny @ SimpleX Chat 2376adaf98 tests: name the test in retry lines (#1994) 2026-10-26 21:54:20 +00:00
Evgeny @ SimpleX Chat c0c416daf0 agent, ntf server: add lookupOrInsertIO, use it for locks and stats (#1989)
* agent, ntf server: add lookupOrInsertIO, use it for locks and stats

* agent, server: use lookupOrInsertIO for map entries

* agent: use lookupOrInsertIO for server stats, keep GET lock in one transaction

* smp server: update getSubscription comment for lookupOrInsertIO result

* agent, server: keep original function names, reduce diff

* agent, server: simplify incServerStat and getMessage

* agent, ntf server: stat under whenPendingSub, lookupOrInsertIO in addPendingSubs

* smp server, session: use lookupOrInsertIO directly, drop the newSub alias

* agent, server: fromEither, remove unused incXFTPServerStat'

* util: hide UnliftIO fromEither where Util fromEither is used

* agent, server: use either id id, remove fromEither

* agent, server: keep isPendingSub, reword service delivery comment
2026-10-26 20:51:24 +00:00
Evgeny @ SimpleX Chat c9b3de83fe ci: reduced build on pushes to master and stable in forks (#1991)
* ci: reduced build on pushes to master and stable in forks

* ci: master pushes finish their cache saves

* ci: test retry message only when retrying
2026-10-26 18:02:44 +00:00
Evgeny @ SimpleX Chat 195df0d094 xftp server: release storage of interrupted uploads (#1977)
* xftp server: release storage of interrupted uploads

* xftp server: release storage of interrupted file deletion
2026-10-26 11:12:25 +00:00
Evgeny @ SimpleX Chat 8a27f54f78 docs: CLAUDE.md importing the contributing and CI guides (#1990) 2026-10-26 10:33:58 +00:00
Evgeny @ SimpleX Chat f23f2ac53e ci: one reduced build job on draft pull requests and manual runs (#1986)
* ci: one reduced build job on draft pull requests and manual runs

* ci: reject manual runs on tags

* ci: reduced job by job condition, tests only when selected

* ci: test selection and retries in scripts/ci/run-tests.sh

* ci: guide to reduced builds and test selection
2026-10-26 10:25:15 +00:00
Evgeny @ SimpleX Chat 3818284007 xftp: close connection after failed handshake (#1974) 2026-10-25 13:53:56 +00:00
Evgeny @ SimpleX Chat bba4cb5874 ntf server: continue notifications when SMP service becomes unavailable (#1976) 2026-10-25 09:24:11 +00:00
Evgeny @ SimpleX Chat 14122174c9 smp server: keep queues blocked with notice after restart and import (#1971) 2026-10-25 09:10:45 +00:00
Evgeny @ SimpleX Chat 31172c4251 clients: close interrupted connection attempts (#1967)
* client: kill transport thread on interrupt

* tests: close cancelled HTTP/2 connection attempt, stalling listener
2026-10-25 09:10:09 +00:00
Evgeny @ SimpleX Chat 568cd2c68c xftp: prohibit YAML aliases, limit file description replicas (#1965)
* xftp: limit description replicas, no YAML aliases

* inline limits

* xftp: derive file description chunk limit from maximum file size

* xftp: allow descriptions of 64 GB files at redundancy 4
2026-10-25 07:32:32 +00:00
Evgeny @ SimpleX Chat 11673c2450 agent, server: one thread per worker; close sockets in reader threads (#1972)
## Agent

- Workers: a worker started by concurrent calls runs in one thread. `runWorkerAsync` put back a stale "not running" value after another call had taken the running one, and a worker restart wrote the same value, so a second thread executed the same commands (for example, a confirmation was sent twice and `CON` was emitted twice), or a caller blocked forever.
- Delivery receipts that fail with AUTH are deleted without an error event.
- Notification credentials are stored per receive queue rather than per connection.
- The protocol client fails pending requests when its connection ends.
- XFTP: a failure to remove a received file's temporary data is logged and no longer fails the worker; server test files have random names.

## Server

- An inactive SMP client session ends without its connection being closed by the expiration thread.
- An inactive HTTP2 session is ended by killing its thread rather than closing its TLS connection from another thread.
- Static files: the timeout handler kills the connection thread and leaves the socket close to that thread.

## Dependencies

- warp: simplex-chat/wai@63667cb5 (simplex-chat/wai#1). The timeout manager kills the connection thread without closing its socket.

## CI and tests

- Tests run on a RAM disk on Linux.
- Test HTTP2 clients are closed before their TLS connections; test temporary directories are cleared between suites.
2026-10-25 07:24:36 +00:00
Evgeny @ SimpleX Chat 14b98672be lib: parse IPv6 addresses with IPv4 suffix (#1969)
* transport: IPv6 with IPv4 suffix, ntf server: decode servers per row

* keep domain name parser

* ntf server: decode servers as on master, tests: IPv6 hosts after restart
2026-10-25 05:38:32 +00:00
Evgeny @ SimpleX Chat 5b79311ac8 agent: report duplicate connection when joining a used one-time link (#1970)
* agent: check connection when adding send queue

* simplify createSndConn

* agent: check confirmed send queue before adding to connection

* agent: report duplicate connection when joining a used one-time link
2026-10-25 04:50:10 +00:00
Evgeny @ SimpleX Chat fd58a2eedf transport, crypto: certificate chain, keys and DH secret (#1964) 2026-10-24 17:46:55 +01:00
sh 8286303d0f smp-server: fix notification store key leak (#1907)
* smp-server: remove expired notification store keys

* smp-server: remove delivered notification keys

* tests: generate MsgId for ntf store test

* smp-server: keep ntf store comments in place

* smp-server: strict count of expired notifications
2026-10-23 09:55:12 +01:00
EvgenyandEvgeny @ SimpleX Chat f795c44b64 ntf server: one db connection to find subscription (#1956)
* ntf server: one db connection to find subscription

* pass connection to getNtfToken_

* getNtfToken_' with connection

* getNtfToken' with connection, inline

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-23 08:36:10 +01:00
EvgenyandEvgeny @ SimpleX Chat 7b2403671d server: retry accept, cache static files (#1962)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-21 23:32:15 +01:00
EvgenyandEvgeny @ SimpleX Chat 69d55c387a smp server: check correlation ID of forwarded transmission (#1954)
* smp server: check correlation ID of forwarded transmission

* simpler

* change error

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-21 14:35:16 +01:00
EvgenyandEvgeny @ SimpleX Chat fa0d1be801 agent: known host, smp protocol: parse empty messages (#1953)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-21 08:24:49 +01:00
Evgeny Poberezkin 8bc4d36012 7.1.0.14 2026-10-19 11:40:39 +01:00
EvgenyandEvgeny @ SimpleX Chat aabf4cdab9 agent: autoincrement IDs in sqlite (#1951)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-18 22:24:50 +01:00
Evgeny Poberezkin 793f6721f6 7.1.0.12 v7.1.0-beta.4 2026-10-17 10:43:54 +01:00
sh 4b8d31a476 smp-server: remove deleted queues from store maps (#1947) 2026-10-16 09:46:09 +01:00
shandEvgeny @ SimpleX Chat e91711c7d7 smp-server: remove journal store leftovers (#1946)
* smp-server: remove postgres queue cache

* smp-server: remove queue locks

* smp-server: simplify message store class

* smp-server: remove unused functions and exports

* tests: remove journal leftovers

* agent: remove unused lock exports

* fix

* fixes

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-15 19:36:45 +01:00
f1f079044c smp-server: remove journal message store (#1919)
Co-authored-by: sh <github.shum@liber.li>
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-15 17:37:49 +01:00
EvgenyandEvgeny @ SimpleX Chat 9d83c0378e tests: execute in parallel, agent: fix race condition with files and when switching queue (#1932)
* tests: execute in parallel

* fix test

* fix postgresql build

* fix test

* fix test

* fix some tests

* fix tests

* fix tests

* fix test

* update schema

* fix test

* update schemas

* diff

* fix race

* fixes

* update schemas

* fix tests

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-15 14:10:04 +01:00
sh 1d39da91c5 smp-server: enforce command concurrency limit (#1944)
* smp-server: hold command slot until completion

* smp-server: command slot wait timeout and stats

* smp-server: clarify command slot comments

* smp-server: simplify command slot fork

* smp-server: limit direct RSLV per client

* smp-server: distinct error for RSLV slot timeout

* smp-server: client command slot wait timeout

* smp-server: reply to forwarded RSLV slot timeout

* smp-server: raise default concurrency limits

* smp-server: simplify command slot wait
2026-10-15 13:58:07 +04:00
Evgeny Poberezkin cba1382356 7.1.0.11 2026-10-11 22:33:06 +01:00
EvgenyandEvgeny @ SimpleX Chat b5e8a4b8cc fix tests on ghc 8.10.7 (#1939)
* fix tests on ghc 8.10.7

* fix test

* fix schema dump test

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-11 20:36:51 +01:00
EvgenyandEvgeny @ SimpleX Chat 3db4029bb9 ci: build cache (#1938)
* ci: build cache

* update build job

* rename steps, cache all builds, patch timestamps for ghc 8.10.7

* refactor, save O0 caches in master and stable builds

* update build to include toolchain fingerprint

* do not save cache on exact match

* remove caching docker from prs

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-11 11:52:24 +01:00
EvgenyandEvgeny @ SimpleX Chat 8a80727fa5 smp server: delayed AUTH responses (#1937)
* smp server: delayed AUTH responses

* plan

* update

* simplify

* simplify

* stat when sent without delay

* update schema

* round up response time to the nearest delay multiple

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-11 07:37:33 +01:00
EvgenyandEvgeny @ SimpleX Chat a2f985dc68 agent: prepare invitation link, create ratchet when connection is prepared (#1880)
* agent: prepare invitation link

* simplify

* refactor

* fix

* change min SMP version to 15

* remove dead code for SMP version <= 15

* update

* diff

* create ratchet when connection is prepared

* createRatchetIfNotExists

* clean up, only check client notices for contacts, fix orphan record

* simplify

* refactor

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-10 23:15:19 +01:00
EvgenyandEvgeny @ SimpleX Chat c18e0297c4 agent: migration to add index to read queues (#1934)
* agent: migration to add index to read queues

* update postgres schema

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-08 17:07:55 +01:00
EvgenyandEvgeny @ SimpleX Chat e24d537eaa agent: fix race when switching reception to the new queue (#1933)
* agent: fix race when switching reception to the new queue

* return bool

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-10-08 16:03:06 +01:00