Commit Graph
63 Commits
Author SHA1 Message Date
Efim Poberezkin f50da16d0a reorganize Protocol and Agent Store (#25)
* chore: move members from Server/Transmission.hs to Protocol.hs

* chore: revert qualified SMP import for server and client

* chore: fix corrId call

* chore: move common types to Common.hs

* chore: decompose SQLite.hs

* chore: rename Agent/Transmission.hs ErrorType -> AgentErrorType

* chore: move Protocol ErrorType -> Common SMPErrorType

* chore: rename Common -> Types

* chore: revert SMPErrorType -> ErrorType
2021-02-26 18:11:22 +04:00
Evgeny Poberezkin 70fe7616f2 Sending messages end to end (#21)
* duplex connection end-to-end (working, debug logs)

* agent: send, receive, acknowledge messages

* logging proposal

* logging: client/server (dis)connections

* agent scenario testing framework

* add tests, remove logs

* clean up
2021-02-26 18:11:22 +04:00
Evgeny PoberezkinandEfim Poberezkin 65dd693c83 parse agent messages with attoparsec (#18)
* parse agent messages with attoparsec (WIP)

* agent: refactor parsers

* agent: parse commands and responses with attoparsec

* refactor UTCTime parser

* fix: updateRcvQueueStatus args

* remove outdated comment

* message parsing: PR feedback

Co-authored-by: Efim Poberezkin <efim.poberezkin@gmail.com>
2021-02-26 18:11:22 +04:00
Efim Poberezkin c14b0251d5 agent store: add getReceiveQueue 2021-02-26 18:11:22 +04:00
Efim Poberezkin 8ab79b066d agent store: add update queue methods (#19) 2021-02-26 18:11:22 +04:00
Efim PoberezkinandEvgeny Poberezkin c1f15c9d93 tests: randomize db file name to fix io errors (#16)
* tests: check file doesn't exist in store tests after

* Revert "tests: check file doesn't exist in store tests after"

This reverts commit de624433a9.

* [WIP] tests: randomize db file

* [WIP] tests: try runIO to get filename into after

* random db file name for agent tests

* tests: randomize DB file name

* tests: increase SMP agent start delay

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-02-26 18:11:22 +04:00
Efim Poberezkin 5f59fcc969 agent store: add createMsg (#14) 2021-01-15 19:30:11 +04:00
Evgeny Poberezkin 2e6ba85308 SMP client library (#9)
* functions to send SMP commands and receive responses

* refactor agent: use SMPClient

* fix tests, remove ServerClient.hs

* refactor processCommand

* fix Agent.hs

* fix SMPClient, tests

* "forever" to SMPClient process
2021-02-26 18:09:26 +04:00
Evgeny Poberezkin 02a15f9f25 agent tests (#8) 2021-02-26 18:09:26 +04:00
Efim Poberezkin 1c5325babf agent store: add positive updateQueueStatus tests for snd and rcv conns (#10) 2021-01-12 19:01:53 +04:00
Efim Poberezkin 123fe0e3e2 agent store: adjust tests hierarchy 2021-01-11 20:28:20 +04:00
Efim Poberezkin 7f22dcd496 agent store: add updateQueueStatus tests 2021-01-11 19:34:30 +04:00
Evgeny Poberezkin 6f8b3787b0 server: refactor syntax tests to only allow one command (#5)
* server: refactor syntax tests to only allow one command

* simplify smpServerTest
2021-01-11 14:04:21 +00:00
Evgeny Poberezkin ea6496ca24 better MonadUnliftIO instance for ExceptT; fix tests 2021-01-09 20:35:19 +00:00
Evgeny Poberezkin 0d0a12f778 refactor store: m (Either e a) => ExceptT e m a 2021-01-09 11:18:52 +00:00
Efim Poberezkin af5bd101cb agent store: make create connection methods return () 2021-01-08 15:51:33 +04:00
Efim Poberezkin 19238c6cc4 agent store: add deleteConn and tests 2021-01-07 17:58:46 +04:00
Efim Poberezkin 6dff023965 test: set up and tear down db per test 2021-01-07 14:51:49 +04:00
Efim Poberezkin e692cb0119 add addRcvQueue and tests 2021-01-07 14:00:53 +04:00
Evgeny Poberezkin 51cc602bdb agent store: refactor addSndQueue 2021-01-06 20:22:00 +00:00
Efim Poberezkin 5a6b1c67a9 add test testAddSndQueue 2021-01-06 23:01:53 +04:00
Efim Poberezkin 94d0be5d27 add test for addSndQueue 2021-01-06 22:35:04 +04:00
Evgeny Poberezkin 6e6ad0fb9b agent store: getConn with tests 2021-01-05 20:31:01 +00:00
Efim Poberezkin 799d179f6f add createSndConn test 2021-01-05 18:03:57 +04:00
Evgeny Poberezkin 5d2e77f41d test: agent SQLite createRcvConnection 2021-01-04 20:25:02 +00:00
Evgeny Poberezkin f8e25189db move all tests from main Test to ServerTests 2021-01-04 18:49:28 +00:00
Evgeny Poberezkin 42ab7fb6ac test against localhost 2020-12-30 21:26:46 +00:00
Evgeny Poberezkin 80b4ff365d TCP client: try all resolved addresses, not just the first 2020-12-30 21:25:49 +00:00
Evgeny Poberezkin f3cd3eac58 add protocol version in TCP welcome 2020-12-30 18:50:50 +00:00
Evgeny Poberezkin 87f2c20ee4 type CorrelationId -> newtype CorrId (to avoid incorrect order in tuple) 2020-12-28 17:41:30 +00:00
Evgeny Poberezkin 43baacc5be move SMP server specific methods from Transport to Server/Transmission 2020-12-28 17:07:11 +00:00
Evgeny Poberezkin e7581a91a8 test: update tests to include correclation ID in the tests themselves 2020-12-28 15:39:28 +00:00
Evgeny Poberezkin 4b8f6417f8 add correlationId to SMP transmissions, fix tests 2020-12-28 13:55:53 +00:00
Evgeny Poberezkin 2ed24e683e rename Config to ServerConfig 2020-12-25 16:46:17 +00:00
Evgeny Poberezkin 3cb2421373 move modules to folder Simplex.Messaging.Server 2020-11-22 18:22:20 +00:00
Evgeny Poberezkin 35f83b604a rename "connection" to "queue" 2020-10-22 12:50:55 +01:00
Evgeny Poberezkin 3d322f5fcf test: error when ACK is sent without message 2020-10-21 18:17:11 +01:00
Evgeny Poberezkin 2527cf8a65 cancel subscribers when client disconnects, reject ACK if MSG was not delivered 2020-10-21 10:08:50 +01:00
Evgeny Poberezkin acef2bf638 tests: deleting undelivered messages, re-delivery when message not ACKed 2020-10-18 10:15:30 +01:00
Evgeny Poberezkin 3012d4586f test: switching subscription to another TCP connection 2020-10-17 20:10:40 +01:00
Evgeny Poberezkin 0dec506ce6 test: duplex communication over 2 SMP connections 2020-10-17 19:42:15 +01:00
Evgeny Poberezkin eba6dfc343 make sizes of IDs a server configuration 2020-10-17 18:13:20 +01:00
Evgeny Poberezkin 98a85ddf5d load 3 lines before parsing 2020-10-17 17:29:23 +01:00
Evgeny Poberezkin 3255682bf2 use base64 encoded IDs and bytestrings instead of strings 2020-10-17 15:01:25 +01:00
Evgeny Poberezkin 5a0402d0c4 random connection and message IDs 2020-10-17 11:07:09 +01:00
Evgeny Poberezkin ee40927506 random connection and message IDs 2020-10-17 11:03:38 +01:00
Evgeny Poberezkin 37eb4e7b71 remove connection ID from IDS response 2020-10-17 08:05:22 +01:00
Evgeny Poberezkin 9efcde6f57 fix: killing subscriber when smp connection is SUBd in another tcp connection 2020-10-16 22:29:21 +01:00
Evgeny Poberezkin bd0f767282 message delivery 2020-10-16 13:24:26 +01:00
Evgeny Poberezkin f3658abfbe rename command HOLD to OFF 2020-10-15 21:32:15 +01:00