Commit Graph
100 Commits
Author SHA1 Message Date
link2xt cbc18ee5a4 Log connection errors 2023-03-14 18:49:14 +00:00
link2xt 28d9bec0b4 Patch default-net 2023-03-10 17:14:01 +00:00
link2xt e39011a43b Release 1.111.0 2023-03-05 13:26:22 +00:00
link2xt 3df5e6e9d3 Use "dep:" syntax to avoid creating dependency features
It is supported since Rust 1.60
2023-03-04 10:24:16 +00:00
link2xt fe60b2dd2d Update scripts/anroid-rpc-server.sh
Ported changes from deltachat-android/scripts/ndk-make.sh
2023-03-04 09:35:56 +00:00
link2xt 260dbbd36f Optimize release builds and dependencies for size 2023-03-03 18:43:53 +00:00
link2xt 7e5a8714a0 Add scripts/codespell.sh and spellcheck 2023-03-03 18:40:36 +00:00
link2xt 9c48bf9d13 Upgrade rustyline to 11.0.0 2023-03-02 10:43:29 +00:00
link2xt 4e166b1b4a Run cargo update 2023-03-01 22:42:03 +00:00
link2xt 2dc04220b8 Simplify dc_jsonrpc_init 2023-02-28 22:46:24 +00:00
link2xt c79ded1406 Fixes for get_webxdc_blob documentation 2023-02-27 14:36:57 +00:00
link2xt d1d43e889a python: add more type annotations 2023-02-27 13:07:35 +00:00
link2xt 7bdf79dee5 python: do not shadow variables to fix pyright warnings 2023-02-27 13:07:35 +00:00
link2xt a6b2c25d42 Move changelog to the unreleased section and add PR number 2023-02-27 08:26:34 +00:00
link2xt 50d83ff063 Remove ResyncFolders job 2023-02-26 22:31:53 +00:00
link2xt a2f1df052b Autoformat create-provider-data-rs.py 2023-02-26 21:27:21 +00:00
link2xt 0086232bbb Rename update-provider-database.py into create-provider-data-rs.py 2023-02-26 21:27:21 +00:00
link2xt 8e9bb8b06e Check provider database with CI
scripts/update-provider-database.sh checks out the provider database
and updates data.rs file,
making it easier to update.

CI uses this script to check that checked in data.rs
corresponds to the provider database repository.
2023-02-26 21:27:21 +00:00
link2xt 7e132b5383 Add cargo-deny config and CI 2023-02-26 20:52:53 +00:00
link2xt 8177070673 Set minimum TLS version to 1.2 2023-02-26 18:48:32 +00:00
link2xt eace8c5fee Note that 1.108.0 re-enables SMTP pipelining 2023-02-25 15:02:05 +00:00
link2xt 992a6cbfc2 mimeparser: wrap try_decrypt() into block_in_place()
try_decrypt() is a CPU-bound task.
When called from async function,
it should be wrapped in tokio::task::spawn_blocking().
Using tokio::task::spawn_blocking() is difficult here
because of &mail, &private_keyring and &public_keyring borrows,
so we should at least use tokio::task::block_in_place()
to avoid blocking the executor.
2023-02-25 11:00:05 +00:00
link2xt 1450bf5483 Remove Job::delay_seconds()
It always returned 0 for added jobs.
2023-02-25 02:45:22 +00:00
link2xt 9f804c379c Remove always zero argument to Job::new() 2023-02-25 02:42:14 +00:00
link2xt 10e8bcb73e job: remove unused variable 2023-02-25 02:35:08 +00:00
link2xt 7f2ccfb168 job: remove match with a single branch 2023-02-25 02:33:47 +00:00
link2xt 3fc67de35e Stop saving and loading jobs.param column 2023-02-25 02:33:21 +00:00
link2xt 8f0d07b93c Make smeared timestamp creation non-async
Using atomic operations instead,
so create_smeared_timestamp() can be used in sync functions,
such as SQL transactions.
2023-02-25 01:10:56 +00:00
link2xt 0890b669fa Move RFC URLs in standards.md to the end
Also update Autodiscover URL
2023-02-24 23:47:51 +00:00
link2xt c02c5ffe2c Format docs_wheels.yml with prettier 2023-02-24 22:31:04 +00:00
link2xt 064f806d90 Remove UpdateRecentQuota job 2023-02-24 17:49:08 +00:00
link2xt b6336ce7e9 Add Unreleased changelog section 2023-02-24 17:46:45 +00:00
link2xt aeadbb35f3 Remove empty API-Changes section 2023-02-24 17:46:35 +00:00
link2xt 45817fcacd Release 1.110.0 2023-02-24 17:05:10 +00:00
link2xt c8ce4ce5aa Switch to "vX.Y.Z" tagging scheme
Previously we used tags like "1.109.0" and "py-1.109.0".
Since Python bindings are always released
at the same time as the core,
it is easier to use a single tag for them.

"v" prefix is added to make matching by "v*" easier
in CI and scripts.
2023-02-24 16:48:37 +00:00
link2xt 7af1a19491 Do not build more than one deltachat-rpc-server at a time 2023-02-24 15:16:38 +00:00
link2xt d0a7e5f1b7 Update timestamps in parameters with transactions
This avoids accidentally reverting the changes
to the `param` column done by another thread.
2023-02-24 14:39:59 +00:00
link2xt a82b09bfc2 Move TLS support to net::tls module 2023-02-24 13:23:17 +00:00
link2xt e9668b3cfa Cache INSERT statement in receive_imf
It reduces iteration time by ~8% in message reception benchmarks
ran by `cargo criterion --bench receive_emails`.
2023-02-24 10:51:55 +00:00
link2xt bc9e347a80 ci: there are no staging and trying branches 2023-02-24 01:14:00 +00:00
link2xt b5187661ee ci: cancel running node.js tests when the branch is updated
Do not waste CI time running the tests for previous commit.
2023-02-24 01:13:40 +00:00
link2xt 059c673d00 ci: add workflow to the group
Otherwise it cancels other workflows.
2023-02-23 18:50:44 +00:00
link2xt 76514178b6 ci: do not run CI multiple times on the same branch
Especially for PRs, if the branch is updated
multiple times, only the last commit should be tested.
2023-02-23 18:45:55 +00:00
link2xt 2cc85e6637 Hide some constants from public crate interface 2023-02-23 14:48:25 +00:00
link2xt ade3d0d4eb Add more documentation comments 2023-02-23 12:55:43 +00:00
link2xt ee81d61988 Fix ruff warnings 2023-02-23 01:31:09 +00:00
link2xt 880ee63fed Document aarch64-unknown-linux-musl.sh 2023-02-22 20:39:46 +00:00
link2xt b0f77f7a33 ci: add arch prefix to deltachat-rpc-server binary names 2023-02-22 20:13:27 +00:00
link2xt cff4a9dce3 ci: cross-compile deltachat-rpc-server for aarch64 Linux 2023-02-22 19:50:42 +00:00
link2xt 5dc20a5b98 ci: link deltachat-rpc-server statically on Linux 2023-02-22 18:56:37 +00:00
link2xt 9e28ee95e5 Document PeerstateChange 2023-02-22 15:10:33 +00:00
link2xt adb5bc77c4 Enable clippy::missing_docs_in_private_items in deltachat-ffi 2023-02-22 14:51:13 +00:00
link2xt c7b7fbaf78 ci: use minimal profile for rustup
Avoid installing unnecessary documentation.
2023-02-22 13:53:02 +00:00
link2xt 42a18d4d0d Unpin ruff version
False positive is fixed in the latest version.
2023-02-22 11:27:37 +00:00
link2xt 999a9550f5 Remove explicit native-tls dependency 2023-02-22 05:09:38 +00:00
link2xt 7f5217fc87 ci: do not try to cross-compile deltachat-rpc-server on i686
It does not work because vendored OpenSSL compilation fails
2023-02-22 01:07:31 +00:00
link2xt df96fbdcef ci: error if deltachat-rpc-server artifact cannot be uploaded 2023-02-22 00:37:17 +00:00
link2xt edec80a917 ci: attempt to fix binary path for artifact upload 2023-02-22 00:35:35 +00:00
link2xt 439c57e3ac ci: fix typo in deltachat-rpc-server.yml 2023-02-22 00:32:30 +00:00
link2xt 7bfff6c87c ci: disable fail-fast on deltachat-rpc-server.yml builds 2023-02-22 00:11:45 +00:00
link2xt 57f221dcc9 Enable "vendored" feature on "deltachat-jsonrpc" from "deltachat-rpc-server" 2023-02-22 00:04:42 +00:00
link2xt 79212bee13 Add "vendored" feature to deltachat-jsonrpc 2023-02-22 00:03:40 +00:00
link2xt 178e67a262 Add "vendored" feature to deltachat-rpc-server 2023-02-22 00:00:32 +00:00
link2xt 877b3551ae ci: add --target option when build deltachat-rpc-server 2023-02-21 23:54:20 +00:00
link2xt a616c69f9a ci: add missing include to deltachat-rpc-server.yml 2023-02-21 23:40:45 +00:00
link2xt df1c1addfb ci: add action to build deltachat-rpc-server 2023-02-21 23:35:53 +00:00
link2xt 45abaff275 Update provider database 2023-02-21 14:41:13 +00:00
link2xt e86fbf5855 ci: stop using deprecated Ubuntu 18.04
GitHub Actions fails running 18.04 jobs currently:
<https://github.com/actions/runner-images/issues/6002>
2023-02-21 13:10:12 +00:00
link2xt c01a2f2c24 Fix missing imports in deltachat_rpc_client 2023-02-21 12:21:17 +00:00
link2xt 05a274a5f3 Enable more ruff checks in deltachat-rpc-client 2023-02-21 11:17:10 +00:00
link2xt f07206bd6c Pin ruff version in deltachat-rpc-client
Latest versions 0.0.248 and 0.0.249 report false positive:
src/deltachat_rpc_client/client.py:105:9: RET503 [*] Missing explicit `return` at the end of function able to return
2023-02-20 19:57:54 +00:00
link2xt 92c7cc40d4 sql: replace .get_conn() interface with .call()
.call() interface is safer because it ensures
that blocking operations on SQL connection
are called within tokio::task::block_in_place().

Previously some code called blocking operations
in async context, e.g. add_parts() in receive_imf module.

The underlying implementation of .call()
can later be replaced with an implementation
that does not require block_in_place(),
e.g. a worker pool,
without changing the code using the .call() interface.
2023-02-20 18:54:29 +00:00
link2xt 56d10f7c42 Use transaction in update_blocked_mailinglist_contacts 2023-02-20 17:17:59 +00:00
link2xt 4790ad0478 Merge switching SQLite connection pool from FIFO to LIFO 2023-02-20 16:43:19 +00:00
link2xt eaa2ef5a44 sql: start transactions as IMMEDIATE
With the introduction of transactions in Contact::add_or_lookup(),
python tests sometimes fail to create contacts with the folowing error:

Cannot create contact: add_or_lookup: database is locked: Error code 5: The database file is locked

`PRAGMA busy_timeout=60000` does not affect
this case as the error is returned before 60 seconds pass.

DEFERRED transactions with write operations need
to be retried from scratch
if they are rolled back
due to a write operation on another connection.

Using IMMEDIATE transactions for writing
is an attempt to fix this problem
without a retry loop.

If we later need DEFERRED transactions,
e.g. for reading a snapshot without locking the database,
we may introduce another function for this.
2023-02-20 15:05:35 +00:00
link2xt 2eeacb0f8a sql: organize connection pool as a stack rather than a queue
When connection pool is organized as a stack,
it always returns most recently used connection.
Because each connection has its own page cache,
using the connection with fresh cache improves performance.

I commented out `oauth2::tests::test_oauth_from_mx`
because it requires network connection,
turned off the Wi-Fi and ran the tests.

Before the change, with a queue:
```
$ hyperfine "cargo test"
Benchmark 1: cargo test
  Time (mean ± σ):     56.424 s ±  4.515 s    [User: 183.181 s, System: 128.156 s]
  Range (min … max):   52.123 s … 68.193 s    10 runs
```

With a stack:
```
$ hyperfine "cargo test"
Benchmark 1: cargo test
  Time (mean ± σ):     29.887 s ±  1.377 s    [User: 101.226 s, System: 45.573 s]
  Range (min … max):   26.591 s … 31.010 s    10 runs
```

On version 1.107.1:
```
$ hyperfine "cargo test"
Benchmark 1: cargo test
  Time (mean ± σ):     43.658 s ±  1.079 s    [User: 202.582 s, System: 50.723 s]
  Range (min … max):   41.531 s … 45.170 s    10 runs
```
2023-02-20 15:00:37 +00:00
link2xt 840497d356 format mergeable.yml 2023-02-20 11:49:59 +00:00
link2xt 0dd87b0bae ci: format .yml with prettier 2023-02-20 11:48:57 +00:00
link2xt e2151e26ee ci: pin rustfmt version 2023-02-19 23:40:04 +00:00
link2xt 446214fd7b sql: use transaction in Contact::add_or_lookup() 2023-02-19 23:16:44 +00:00
link2xt 9389e11007 ffi: log create_contact() errors 2023-02-19 23:16:44 +00:00
link2xt 5bdd49b451 Add Unreleased section to changelog 2023-02-19 21:57:36 +00:00
link2xt 42a7e91f05 python: stop using pytest-rerunfailures 2023-02-19 21:55:28 +00:00
link2xt 44953d6bcc Release 1.109.0 2023-02-19 21:40:33 +00:00
link2xt 10066b2bc7 sql: use semaphore to limit access to the connection pool
This ensures that if multiple connections are returned
to the pool at the same time, waiters get them in the order
they were placed in the queue.
2023-02-19 17:06:25 +00:00
link2xt f65e1c1587 Sort dependencies in Cargo.toml 2023-02-19 13:18:58 +00:00
link2xt 626ec5e793 Document the meaning of empty Message.subject 2023-02-19 13:05:39 +00:00
link2xt 85517abf58 Derive Debug for Pool 2023-02-19 02:26:26 +00:00
link2xt 75f65b06e8 Run VACUUM on the same connection as sqlcipher_export
Otherwise export_and_import_backup test fails due to SQLITE_SCHEMA error.
2023-02-19 02:26:26 +00:00
link2xt f2b05ccc29 Reimplement connection pool on top of crossbeam 2023-02-19 02:26:26 +00:00
link2xt e88f21c010 Remove try_many_times r2d2 bug workaround 2023-02-19 02:26:26 +00:00
link2xt ed8e2c4818 Replace r2d2 with an own connection pool
New connection pool does not use threads
and does not remove idle connections
or create new connections at runtime.
2023-02-19 02:26:26 +00:00
link2xt 48fee4fc92 python: replace "while 1" with "while True"
This makes pyright recognize that the function never returns implicitly.
2023-02-18 11:31:07 +00:00
link2xt 7586bcf45e Update rusqlite to 0.28 2023-02-17 14:48:33 +00:00
link2xt 870527de1e Remove r2d2_sqlite dependency 2023-02-17 11:06:17 +00:00
link2xt a34aeb240a Increase database timeout to 60 seconds 2023-02-16 18:37:47 +00:00
link2xt 6ee165fddc python: type annotations for testplugin.py 2023-02-16 17:48:29 +00:00
link2xt c9db41a7f6 python: build Python 3.11 wheels 2023-02-16 14:36:23 +00:00
link2xt 7a6bfae93b Fix typo 2023-02-16 11:42:59 +00:00
link2xt ae19c9b331 Add more documentation 2023-02-15 21:56:33 +00:00