Evgeny
7762b4d364
reduce the number of STM transactions ( #1255 )
...
* reduce the number of STM transactions
* reduce STM more
* refactor
* remove more
2024-08-09 16:38:46 +01:00
Evgeny
f4d1a33ed8
agent: retry loop that resumes subscriptions as soon as agent is moved to foreground, suspend retry loops while agent is suspended ( #1249 )
...
* agent: retry loop that resumes subscriptions as soon as agent is moved to foreground, suspend retry loops while agent is suspended
* reset retry enterval when moving to foreground
* account for network state too
* simplify
* typo
* simplify
2024-08-05 15:09:46 +01:00
Evgeny Poberezkin
03ea151be5
agent: support additional messages for connection in message batches ( #1247 )
...
* agent: support additional messages for connection in message batches
* fix, test
* test 2 connections
* use TVar instead of TMVar for GHC 8.10.7
2024-07-30 17:12:29 +01:00
Evgeny Poberezkin
5fa3c149e9
smp server: fix server-info, additional stats, allow expiring inactive clients which have prohibit subscriptions only (iOS NSE clients) ( #1237 )
...
* smp server: fix server-info
* fix
* faster saving messages
* remove comment
* move ProhibitSub out of TVar
* subscription stats
* stabilize test
* order
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* more notification stats
* count ntf stats
* update server-info
---------
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
2024-07-25 16:06:40 +01:00
Evgeny Poberezkin
9093c7b120
agent, ntf server: only mark subscriptions as pending that were created by the disconnected client ( #1242 )
...
* ntf server: only mark subscriptions as pending if the disconnected client is current
* add sessionId to subscribed queue
* add sessionId to subscriptions in ntf server agent
* fix
2024-07-25 13:07:28 +01:00
Evgeny Poberezkin
051bf38bc7
agent: remove delays in notification processing, add notification stats ( #1235 )
...
* agent: remove delays in notification processing, add notification stats
* do not replace token after failed check
* more stats
* refactor
* fix
* backwards compatible JSON parsing
* retry deleting subscription on temporary error
* remove attempts to get multiple notification messages
* fix JSON decoding to be backwards compatible
2024-07-22 15:42:34 +01:00
spaced4ndy
7565ddd91c
agent: initialize ratchet on processing confirmation to support decryption of messages received before allowConnection; return SndQueueSecured from joinConnection, acceptContact ( #1233 )
2024-07-18 19:54:14 +04:00
Evgeny Poberezkin
e59a098e66
smp server: remove subscriptions from the clients when queues are deleted ( #1234 )
...
* smp server: remove subscriptions from the clients when queues are deleted
* remove ntf subscriptions, update stats
* add GET stats
2024-07-18 10:59:48 +01:00
Evgeny Poberezkin
784d36d691
socks mode encoding ( #1231 )
...
* socks mode encoding
* test delays
* test delay
* unused import
2024-07-15 20:28:24 +01:00
Evgeny Poberezkin
291039159f
ntf server: use SOCKS proxy to connect to onion-only SMP servers ( #1229 )
...
* ntf server: use SOCKS proxy to connect to onion-only SMP servers
* fix test
2024-07-14 23:19:02 +01:00
Evgeny Poberezkin
d4fa0af350
ntf: additional tests for token registration when server and device are restarted ( #1230 )
...
* ntf: additional tests for token registration when server and device are restarted
* test response timeouts
2024-07-14 17:57:34 +01:00
Evgeny Poberezkin
8dd54ced0e
agent: retry proxied command on NO_SESSION error, to prevent failure of proxied interactive commands (like joining connection) ( #1227 )
2024-07-13 10:06:48 +01:00
Evgeny Poberezkin
e56bd0b47b
agent: add known servers ( #1225 )
...
* agent: add known servers
* test delays
* ServerCfg
* json encoding
* enabledServerCfg
* checkUserServers
2024-07-12 12:41:55 +01:00
Evgeny Poberezkin
21abc5cabe
smp server: reduce the number of threads by delivering message to subscription when it is sent ( #1222 )
...
* smp server: reduce the number of threads by delivering message to subscription when it is sent
* test delay
* test delay
2024-07-08 23:12:01 +01:00
Evgeny Poberezkin
6e76221e07
agent: fix possible dead lock between sending and receiving messages, stress test for message delivery ( #1224 )
...
* agent: fix possible dead lock between sending and receiving messages, stress test for message delivery
* deliver events after the lock is released
* delayed delivery in command processing too
* tests: increase message expiration time
2024-07-08 21:47:42 +01:00
Evgeny Poberezkin
743676421d
ntf server: simplify and optimize subscriptions in server agent ( #1219 )
...
* increase queue size
* simplify
* refactor to optimize memory usage and performance
* comment
* refactor
* test delays
2024-07-07 21:17:12 +01:00
Evgeny Poberezkin
9d0774a58e
agent: add queue information ( #1217 )
...
* agent: add queue information to "debug delivery" response
* fix test
* rename
* encodings
2024-07-03 19:32:27 +01:00
Evgeny Poberezkin
ce732c0efb
agent: enable fast handshake (revert #1215 ) ( #1216 )
...
* Revert "agent: disable fast handshake (#1215 )"
This reverts commit aa1d8d6c8b .
* remove import
* test delays
2024-07-03 18:05:27 +01:00
Evgeny Poberezkin
aa1d8d6c8b
agent: disable fast handshake ( #1215 )
2024-07-02 13:40:37 +01:00
Evgeny Poberezkin
a6b542b301
Merge branch 'master' into fast-connection
2024-06-30 15:00:28 +01:00
Evgeny Poberezkin
6a54a58a0d
agent: remove legacy statistics ( #1211 )
...
* agent: remove legacy statistics
* delays after disposeAgent
* delays
* enable all tests
* more delays
2024-06-30 12:50:42 +01:00
Evgeny Poberezkin
9ee684b0f4
rfc: faster handshake protocol ( #1203 )
...
* rfc: faster handshake protocol
* update
* 1 message
* SKEY
* use SKEY for both parties
* test
* update doc
* NEW command parameter
* add k=s param to queue URI
* fix
* add sndSecure field to queues
* make sender key non-optional in SndQueue (WIP, tests fail)
* fast handshake sometimes works (many tests fail)
* correctly handle SKEY retries, avoiding to re-generate the keys
* handle SKEY retries during async connection
* fix most tests (1 test fails)
* remove do
* fix contact requests encoding/tests
* export
* fix: ignore duplicate confirmations, fixes testBatchedPendingMessages
* do not store sndSecure in store log if it is false to allow server downgrade
* add connection invitation encoding tests
2024-06-30 08:36:24 +01:00
Evgeny Poberezkin
388d77b61a
ntf stats on SMP server ( #1197 )
...
* log undelivered notifications
* type
* add counters and encoding
* rename
* diff
* style
* style2
---------
Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com >
2024-06-15 20:05:45 -07:00
Alexander Bondarenko
6597f6f0ed
tests: add proxy connection refused test ( #1200 )
2024-06-15 19:27:58 -07:00
spaced4ndy
3c0cd7efcc
agent: separate type for agent file errors ( #1185 )
2024-06-05 18:44:32 +04:00
Evgeny Poberezkin
3d605310ed
agent: remove protocol encodings and agent TCP server ( #1189 )
...
* rfc: remove agent protocol encodings
* agent: remove protocol encodings and agent TCP server
* update
* remove unused code
* remove
* move tests
* add delay to tests
* stabilize test
* test
* more delays
* reduce delays
* enable all tests
* delays
* style
2024-06-05 14:34:40 +01:00
Evgeny Poberezkin
3dab330480
use throwE instead of throwError ( #1187 )
...
* use throwE instead of throwError
* test delay
2024-06-05 11:20:50 +01:00
Evgeny Poberezkin
d12ea92055
agent: report correct errors from xftp handshake so they are treated as temporary ( #1184 )
...
* agent: report correct errors from xftp handshake so they are treated as temporary
* disable slow servers test
* remove comments
* all tests
* remove duplicate functions
2024-05-31 09:47:47 +01:00
Evgeny Poberezkin
88f1b727e0
SMP protocol extension to debug subscribed SMP queues ( #1181 )
...
* SMP protocol extension to debug subscribed SMP queues
* fix, test
* corrections
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* increase delays
* increase timeout
* delay
* delay
* enable all tests
---------
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
2024-05-30 18:49:43 +01:00
Evgeny Poberezkin
5c2c88315a
SMP server information ( #1072 )
...
* SMP server information
* fix tests
* country codes
* smp-server: serve contact and link pages from static files (#1084 )
* smp-server: serve contact and link pages from static files
* generate index
* use params from ini
* render using ServerInformation
* tweak templates
* update
* fix some html
* smp-server: fix layout (#1097 )
* smp-server: fix layout
* port fixes to link page
---------
Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com >
* update server information page
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
Co-authored-by: M. Sarmad Qadeer <MSarmadQadeer@gmail.com >
* update server info
* web: improve server info page design (#1166 )
* web: improve server info page design
* web: fix font errors & some tags
* web: improve contact & invitation page layout and header
* update
* remove unused files/css
* cleanup
* fix link page
* remove unused font links
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
* show contact address as is
---------
Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com >
Co-authored-by: M. Sarmad Qadeer <MSarmadQadeer@gmail.com >
2024-05-29 11:30:42 +01:00
Evgeny Poberezkin
63f5e76f9c
agent: treat absent proxy session as a temporary error to retry sending ( #1178 )
...
* agent: treat absent proxy session as a temporary error to retry sending
* enable all tests
2024-05-29 08:06:01 +01:00
Evgeny Poberezkin
e55ec07fe2
server: log stats for QUOTA and other errors ( #1177 )
...
* server: log stats for QUOTA errors
* fix test
* more stats
* remove duplicate column
2024-05-28 15:32:41 +01:00
Evgeny Poberezkin
199f85ec62
agent: send MWARN on QUOTA errors ( #1176 )
...
* agent: send MWARN on QUOTA errors
* fix tests
2024-05-28 11:56:57 +01:00
Evgeny Poberezkin
4a96dbf871
server: preprocess proxy commands that will not be connecting to network to reduce concurrency, do not wait for destination relay responses before processing the next command ( #1174 )
...
* server: preprocess proxy commands that will not be connecting to network to reduce concurrency
* implementation
* tests
* increase proxy client concurrency
* simplify
* refactor
* refactor2
* rename
* refactor3
* fix 8.10.7
2024-05-28 09:38:47 +01:00
Evgeny Poberezkin
470dc74391
ntf server: do not persist server connection errors
2024-05-24 14:25:05 +01:00
Evgeny Poberezkin
2ff5f5a832
agent: add context to CMD error ( #1167 )
...
* agent: add context to CMD error
* tests, more warnings
* fix tests
* log TBQueue sizes
* log locks
* more logs
* log sendMessagesB
* fix test
* log length
* refactor
* remove logging
* revert lock scope change
* cleanup
* add string error to A_PROHIBITED
* remove
* remove test limitations
* language
2024-05-24 14:13:01 +01:00
Evgeny Poberezkin
875a56b75a
Merge branch 'stable'
2024-05-23 16:48:11 +01:00
Alexander Bondarenko
984394d906
core: remove MonadUnliftIO ExceptT orphans ( #1169 )
2024-05-23 16:44:00 +01:00
Alexander Bondarenko
5d38ad03af
tests: add proxy stress tests ( #1163 )
...
* tests: add proxy stress tests
* organize benches
* add agent tests
* move prints to logNote
* fix stuck agent tests
2024-05-23 15:34:25 +01:00
Evgeny Poberezkin
8097df5540
agent: persist server connection error ( #1165 )
...
* agent: persist server connection
* comment, refactor
* fix tests, reduce interval for ntf server
* cleanup
* 0
2024-05-22 13:25:49 +01:00
Evgeny Poberezkin
5bff2f5537
Merge branch 'stable'
2024-05-21 23:42:49 +01:00
Evgeny Poberezkin
f50589b31a
agent: remove external timeout to resubscribe ( #1164 )
...
* agent: remove external timeout to resubscribe
* liftIO
* fix tests
2024-05-21 22:52:22 +01:00
Alexander Bondarenko
f50fa5c60b
smp-server: limit concurrency in proxy command processing ( #1162 )
...
* smp: put client proxy command processing threads under a shared semaphore
* add LIMITS.max_proc_threads to server config
* rename to PROXY.client_concurrency
* retry on strictly greater than max concurrency
* set default to 16
* rename
* fix limit
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-21 12:53:33 +01:00
Alexander Bondarenko
f89d715a99
smp server: add proxy stats ( #1157 )
...
* smp-server: add proxy counters
* count simplex.im messages
* update
* fix
* get own servers from INI
* remove export
---------
Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com >
2024-05-20 17:07:33 +01:00
spaced4ndy
2e5433676e
xftp: check proxy before downloading from unknown server ( #1102 )
...
* xftp: check proxy before downloading from unknown server
* corrections
* remove import
* tests
* comment
* tests
* don't wrap into internal error
* fix tests
2024-05-20 14:14:04 +01:00
Evgeny Poberezkin
8b21f7ef2a
agent: aggregate multiple expired subscription responses into a single UP event ( #1160 )
...
* agent: aggregate multiple expired subscription responses into a single UP event
* clean up
* refactor processing of expired responses
* refactor
* refactor 2
* refactor unexpectedResponse
2024-05-20 07:56:51 +01:00
Evgeny Poberezkin
7a15ea59c9
Merge branch 'stable'
2024-05-19 07:58:00 +01:00
Evgeny Poberezkin
1bb6a5c43b
agent: do not increase network activity interval while offline ( #1159 )
...
* agent: do not increase network activity interval while offline
* test
2024-05-19 07:50:47 +01:00
Evgeny Poberezkin
077ca9c046
Merge branch 'stable'
2024-05-17 15:38:06 +01:00
Evgeny Poberezkin
33f6d2f1da
agent: optimize waiting for user network to avoid contention for state updates from multiple threads ( #1155 )
...
* haskell magic
* update
* agent: optimize waiting for user network with TChan
* clean up
* Int64
* use TVar
* cleanup
* fix
* testing
* update
2024-05-17 15:12:05 +01:00