Commit Graph
2206 Commits
Author SHA1 Message Date
Evgeny @ SimpleX Chat 402548eb55 tests: accept agent events from independent threads in any order (#2032)
* tests: accept UP and MSG in either order when subscribing

* tests: add the type of the UP and MSG reader

* tests: accept SENT of two connections in any order
2026-11-08 13:26:45 +00:00
Evgeny @ SimpleX Chat 91bfba321b lib: evaluate the new TVar state in stateTVar updates (#2031)
* lib: evaluate random generator state when it is updated

* lib: evaluate the new state in all stateTVar updates
2026-11-07 23:09:51 +00:00
Evgeny @ SimpleX Chat db998ca19f xftp: limit the redirect file of a description to 4 MB (#2026) 2026-11-07 16:29:06 +00:00
Evgeny @ SimpleX Chat e8aff94ca9 lib, ntf server: reject null byte in host and server without key hash (#2027)
* core: reject empty server key hash and null byte in host

* core: reject notification subscription to a server without key hash

* lib: exclude null byte in host with the other excluded characters

* tests: name the subscription server address test by the rejected values
2026-11-07 16:17:27 +00:00
Evgeny @ SimpleX Chat 5f914a040e tests: cover SMP server subscription changes (#2029) 2026-11-07 16:13:40 +00:00
Evgeny @ SimpleX Chat 30d9808f16 xftp: receive files with many chunks, always report receive errors (#2025)
* xftp: receive files with many chunks, always report receive errors

* xftp: hash received file chunks one at a time
2026-11-07 15:57:09 +00:00
Evgeny @ SimpleX Chat 7ca1f4e508 agent: complete file uploads when the app leaves the foreground (#2010)
* agent: continue XFTP uploads started in foreground while suspending

* tests: verify XFTP upload stage of agent suspension

* docs: plan for XFTP uploads while suspending

* docs: revise plan for XFTP uploads while suspending

* docs: revise plan wording for XFTP uploads while suspending

* agent: exclude ended and stopped XFTP uploads from suspension wait

* tests: verify suspension wait for ended and stopped XFTP uploads

* docs: plan decisions for ended XFTP uploads while suspending

* agent: simplify tryBeginAgentOperation with orElse

* agent: rename upload wait functions by the conditions they check

* tests: verify database check and deleted rows at suspension start

* docs: plan residual case, conditions and names for XFTP suspension

* docs: plan tests for the remaining XFTP suspension paths

* tests: verify the remaining XFTP suspension paths

* docs: update plan line references and the query error test

* tests: foreground agent before checking the query error result

* docs: plan line references after merging master and stage diagrams

* agent: one check of the begun database operation when removing deleted or failed counted files

* agent: suspendAgent returns before the database query of counted files

* tests: closed database store tests excluded from PostgreSQL agent builds

* tests: suspension timeout test waits for the timeout and bounds SUSPENDED

* tests: one setup helper for suspension tests with a small sent file, one for the bounded SUSPENDED wait

* tests: suspendAgent returns while the agent database is in use

* docs: plan states the forked removal at suspension start, uncounted redirects, offline files and the changed tests

* docs: plan links the simplex-chat pull request

* agent: suspend timeout starts when suspendAgent returns, not after the database query of counted files

* docs: plan states the separate removal thread and the TTL cleanup interval
2026-11-07 15:23:45 +00:00
Evgeny @ SimpleX Chat 0424f667ee agent: acquire connection locks in order when sending (#2019)
* agent: acquire connection locks in order when sending

* tests: enable OverloadedStrings for lock acquisition tests

* agent: acquire connection locks with explicit recursion
2026-11-07 15:17:20 +00:00
Evgeny Poberezkin c1830fb2db 7.1.0.17 2026-11-07 08:38:47 +00:00
Evgeny @ SimpleX Chat c344dc955f agent: deliver messages between 7.0 and 7.1 apps in old connections (#2023)
* agent: test version 2 ratchets with previous header encoding

* agent: deliver messages between 7.0 and 7.1 apps in old connections

* agent: test version 2 ratchets with v7.0 encoding on master code

* agent: decode headers in version 2 ratchet tests without attoparsec

* agent: deliver messages to and from 7.0 apps in old connections

* agent: choose the header format by its length prefix
2026-11-06 22:49:14 +00:00
Evgeny @ SimpleX Chat 6cfb7cf924 xftp: reject file descriptions with very long numbers (#2018)
* xftp: reject file descriptions with very long numbers

* xftp: simplify the long number guard condition
2026-11-06 22:29:34 +00:00
Evgeny @ SimpleX Chat db1cf85e2a ntf server: resume push notifications after APNS errors (#2020)
* ntf server: resume push notifications after APNS errors

* ntf server: fix push delivery test assertion
2026-11-06 18:56:17 +00:00
Evgeny @ SimpleX Chat 9af1341498 tests: flip one bit in each field of the tampered BBS proof (#2022) 2026-11-06 18:01:25 +00:00
Evgeny @ SimpleX Chat 026d27d082 xftp: send and receive files through servers before v6.5.0 (#2021)
* xftp: test decoding handshake of servers before v6.5.0

* xftp: send and receive files through servers before v6.5.0

* xftp: refuse server handshake with invalid signature
2026-11-06 18:00:36 +00:00
Evgeny @ SimpleX Chat 8934d18071 agent: use private routing for name lookups to known servers (#2002)
* agent: use private routing for name lookups to known servers

* agent: rename proxyKnown to viaProxyForKnown
2026-11-05 21:47:10 +00:00
Evgeny @ SimpleX Chat e66e15b128 servers: serve web pages over HTTP/1.1 (#1999)
* servers: serve web pages over HTTP/1.1

* tests: remove descriptor count check from the HTTP/1.1 page test
2026-11-05 07:52:30 +00:00
Evgeny @ SimpleX Chat c89b00cf06 agent: validate xrcp host certificate chain against paired CA (#2000)
* agent: validate xrcp host certificate chain against paired CA

* agent: send the validation reason when rejecting xrcp host certificates
2026-11-05 07:49:49 +00:00
Evgeny @ SimpleX Chat 32f61fd104 xftp: limit chunk size in received file descriptions (#2001) 2026-11-05 07:48:35 +00:00
brenzi-agent 9c4a814fda resolver: answer a subname only while its name's holder holds it (#2013) 2026-11-03 23:40:05 +00:00
Evgeny @ SimpleX Chat 360f6b5530 ntf server: validate APNS server certificate and host name (#1998)
* ntf server: validate APNS server certificate and host name

* tests: check APNS certificate errors and the system CA store fallback
2026-11-03 22:24:14 +00:00
Evgeny Poberezkin a0eec7104c 7.1.0.16 2026-11-02 10:42:49 +00:00
brenzi-agentandbrenzi-agent 165c897ed8 names: available names carry the terms their buyer accepts (#2003)
* names: an available name carries its bona fide community terms

A bona fide community name can be registered only by someone who
accepts the community terms its name policy keeps. NRAvailable gains
bonaFideTerms_: the terms' text when it fits the answer, else the 0x
hex keccak256 of the text; Nothing for any other name. Nothing is
omitted from the JSON, so a plain name's answer is unchanged, and an
answer without the field decodes as a plain name.

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

* names: the bona fide terms travel as the zstd frame the name policy keeps

The name policy keeps the community terms' text compressed in one zstd
frame, and a buyer accepts the keccak256 of that frame. An available
bona fide name carries the frame when it fits the answer, else its hash.
ZstdTerms is base64url in JSON, as other bytes are.

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

* names: every available name carries the terms its buyer accepts

Every registration accepts terms, not only a bona fide name's. The name
policy keeps the general name terms and the community terms, each as a
zstd frame. NRAvailable's nameTerms is NTName with the general terms, or
NTBonaFide with a bona fide name's community terms, which include them;
either carries the frame when it fits the answer, else its hash. It is
absent only from a router before v24.

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

* names: NTBonaFide is NTCommunity

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

* names: terms are the policy's link to a file, and the file when it fits

* names: general and community terms, as the name policy now names them

---------

Co-authored-by: brenzi-agent <346870783+brenzi-agent@users.noreply.github.com>
2026-11-01 06:46:17 +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 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