Commit Graph
134 Commits
Author SHA1 Message Date
link2xt f7c97d8557 test: add pseudo transport explicitly rather than by setting ConfiguredAddr
ConfiguredAddr is going to be removed, but we need to be able to add fake transports,
also for existing offline Python tests.
2026-09-18 08:09:33 +00:00
holger krekel 3363f63316 test: remove all cache-related logic in the FFI pytest plugin 2026-08-12 22:04:15 +02:00
holger krekel cc229372e4 test: provide complete test isolation by not re-using account addresses
As we are using a dedicated CI relay instance, we don't need to be careful with creating test addresses.
But re-using test addresses in a test running in a single worker can leak events/messages which compromises test isolation.
Instead of encountering random flaky tests because let's just not cache addresses to maximize test isolation.
2026-08-12 22:04:15 +02:00
Hocuri 961cacd795 fix: Correctly delete unneeded messages on the server; Remove "Delete Messages from Server" (delete_server_after) config option (#8240)
Fix https://github.com/chatmail/core/issues/8195
Supersedes https://github.com/chatmail/core/pull/8217

The most interesting change is in `delete_expired_imap_messages()`
because there, messages are marked for deletion on single-device
chatmail profiles.

The logic in `delete_expired_imap_messages()` was wrong before, and
pre-messages were not deleted at all. This is fixed by also querying
`pre_rfc724_mid` in addition to `rfc724_mid` from the `msgs` table.
In order not to make the SQL statement too complex, I split it into two.

WRT tests:
- `test_immediate_autodelete()` tests the auto-deletion;
`test_imap_autodelete_fully_downloaded_msg()` tests that even for a
message that is split into pre- and post-message, both messages are
deleted.
- A lot of tests test that if bcc_self is on, messages are not
auto-deleted. E.g. `test_one_account_send_bcc_setting()` and
`test_markseen_message_and_mdn()` relies on the fact that messages stay
on the server when bcc_self is on.
- Unfortunately, it is not possible to test that messages are only
deleted for chatmail servers, because we don't have any tests that use a
non-chatmail server.
2026-05-22 16:45:50 +00:00
Hocuri 18d878378f api!: Remove unused config smtp_certificate_checks 2026-04-20 15:45:17 +02:00
link2xt 942172a31a feat: remove MvboxMove and OnlyFetchMvbox 2026-04-16 16:42:40 +00:00
iequidoo 18445c09c2 feat: Remove Config::SentboxWatch (#7178)
The motivation is to reduce code complexity, get rid of the extra IMAP connection and cases when
messages are added to chats by Inbox and Sentbox loops in parallel which leads to various message
sorting bugs, particularly to outgoing messages breaking sorting of incoming ones which are fetched
later, but may have a smaller "Date".
2025-10-26 14:17:07 -03:00
link2xt 498a831873 api!: remove APIs to create protected chats
Create unprotected group in test_create_protected_grp_multidev
The test is renamed accordingly.

SystemMessage::ChatE2ee is added in encrypted groups
regardless of whether they are protected or not.
Previously new encrypted unprotected groups
had no message saying that messages are end-to-end encrypted
at all.
2025-10-19 11:35:09 +00:00
bjoernandHocuri 2c7d51f98f feat: add "e2ee encrypted" info message to all e2ee chats (#7008)
this PR adds a info message "messages are end-to-end-encrypted" also for
chats created by eg. vcards. by the removal of lock icons, this is a
good place to hint for that in addition; this is also what eg. whatsapp
and others are doing

the wording itself is tweaked at
https://github.com/deltachat/deltachat-android/pull/3817 (and there is
also the rough idea to make the message a little more outstanding, by
some more dedicated colors)

~~did not test in practise, if this leads to double "e2ee info messages"
on secure join, tests look good, however.~~ EDIT: did lots of practise
tests meanwhile :)

most of the changes in this PR are about test ...

ftr, in another PR, after 2.0 reeases, there could probably quite some
code cleanup wrt set-protection, protection-disabled etc.

---------

Co-authored-by: Hocuri <hocuri@gmx.de>
2025-07-18 22:08:33 +02:00
Hocuriandl 1379821b03 refactor: Move logins into SQL table (#6724)
Move all `configured_*` parameters into a new SQL table `transports`.
All `configured_*` parameters are deprecated; the only exception is
`configured_addr`, which is used to store the address of the primary
transport. Currently, there can only ever be one primary transport (i.e.
the `transports` table only ever has one row); this PR is not supposed
to change DC's behavior in any meaningful way.

This is a preparation for mt.

---------

Co-authored-by: l <link2xt@testrun.org>
2025-04-13 19:06:41 +02:00
link2xt 07946a18c3 test: use QR codes to setup contact with test bots 2025-04-06 09:53:56 +00:00
link2xt 51bbdadfad feat: ignore encryption preferences
Encryption preference is sent in Autocrypt header,
but otherwise ignored.

Delta Chat always prefers encryption if it is available.
2025-03-12 16:44:52 +00:00
link2xt 191eb7efdd chore: fix typos
Applied fixes suggested by scripts/codespell.sh
2024-12-02 19:22:45 +00:00
link2xt 7743072411 refactor: remove addr from KeyPair 2024-09-16 17:00:16 +00:00
iequidooandHocuri ff6488371c feat: Delete messages from a chatmail server immediately by default (#5805) (#5840)
I.e. treat `DeleteServerAfter == None` as "delete at once". But when a backup is exported, set
`DeleteServerAfter` to 0 so that the server decides when to delete messages, in order not to break
the multi-device case. Even if a backup is not aimed for deploying more devices, `DeleteServerAfter`
must be set to 0, otherwise the backup is half-useful because after a restoration the user wouldn't
see new messages deleted by the device after the backup was done. But if the user explicitly set
`DeleteServerAfter`, don't change it when exporting a backup. Anyway even for non-chatmail case the
app should warn the user before a backup export if they have `DeleteServerAfter` enabled.

Also do the same after a backup import. While this isn't reliable as we can crash in between, this
is a problem only for old backups, new backups already have `DeleteServerAfter` set if necessary.

---------

Co-authored-by: Hocuri <hocuri@gmx.de>
2024-09-08 16:53:56 -03:00
iequidoo d40ec88b94 test(python): Wait for bot's DC_EVENT_IMAP_INBOX_IDLE before sending messages to it (#5699)
Bot processes are run asynchronously, so we shouldn't send messages to a bot before it's fully
initialised and skipped existing messages for processing, i.e. before DC_EVENT_IMAP_INBOX_IDLE is
emitted.
2024-06-23 01:46:40 -03:00
link2xt b5e2ded47a Revert "test: Set fetch_existing_msgs for bots (#4976)"
This reverts commit 25b8a482bc.
2024-06-20 02:00:49 +00:00
iequidoo 3b91815240 test(python): Set delete_server_after=1 ("delete immediately") for bots (#4976)
Test bots are run with `fetch_existing_msgs` set, so messages must be deleted immediately not to be
processed again after a bot redeployment.
2024-06-16 22:16:33 -03:00
iequidoo 25b8a482bc test: Set fetch_existing_msgs for bots (#4976)
A bot process is run asynchronously, so some messages can arrive before the bot is fully
initialised.
2024-06-05 18:27:20 -03:00
link2xt 7cfab9a931 test: set configuration after configure() finishes
This allows to overwrite settings changed
when XCHATMAIL capability is detected.
2024-05-15 06:27:57 +00:00
holger krekel acff8205e2 test: fix pytest compat (#5317)
seems pytest_report_header has changed with pytest incompatible but we
don't need it anyway so we can just leave it out.
2024-03-04 21:07:09 +00:00
iequidoo e16322d99d test: get_protected_chat(): Use FFIEventTracker instead of dc_wait_next_msgs() (#5207)
The way it was implemented it threw out all remaining messages after finding the next incoming
message. Better use FFIEventTracker functions, they are used in all the tests anyway.
2024-03-02 12:12:26 -03:00
missytake bbc6febb72 test: no timeout in SetupPlugin 2024-01-17 14:20:29 +01:00
missytake 7f7f42d721 test: Ensure that member is added before yielding chat 2024-01-17 14:20:29 +01:00
missytake 36cab40ac1 test: add get_protected_chat to testplugin.py 2024-01-17 14:20:29 +01:00
holger krekel 9ca049051c fix and streamline a little 2023-11-10 16:46:40 +01:00
Sebastian Klähn 790509676f fix: remove unused --liveconfig option
close  #4892
2023-11-10 16:46:40 +01:00
link2xt 4e21917c0e feat: enable sync messages by default 2023-11-05 21:11:47 +00:00
link2xt 6aae0276da test: use instant accounts instead of mailadm 2023-10-30 00:15:22 +00:00
link2xt 532e9cb09a refactor: ignore public key argument in dc_preconfigure_keypair()
Public key can be extracted from the secret key file.
2023-09-30 19:16:23 +00:00
link2xt 740f43a2d6 fix: do not resync IMAP after initial configuration
If there was no previous `configured_addr`,
then there is no need to run IMAP resync.
2023-07-17 16:38:09 +00:00
link2xt 88759c815b refactor(python): flatten the API of deltachat module 2023-07-03 16:19:31 +00:00
link2xt b2993242e4 docs(python): document pytest fixtures
These docstrings are displayed by `pytest --fixtures`
when `deltachat` package is installed from PyPI.
2023-06-05 18:34:27 +00:00
iequidoo 0a2200c2c8 python: Wait for initial Resync in the bot tests 2023-03-31 17:15:02 -03:00
link2xt 7e5a8714a0 Add scripts/codespell.sh and spellcheck 2023-03-03 18:40:36 +00:00
link2xt d1d43e889a python: add more type annotations 2023-02-27 13:07:35 +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 6ee165fddc python: type annotations for testplugin.py 2023-02-16 17:48:29 +00:00
link2xt cd3f1fe874 python: autoformat with black 2023-02-15 17:15:43 +00:00
link2xt 01653a881a python: do not import print function 2023-02-15 16:28:16 +00:00
link2xt 817760a6ef python: upgrade from .format() to f-strings
They are supported since Python 3.5.
2023-02-08 15:44:34 +00:00
link2xt fac7b064b4 Refine Python CI
Add lint environment to `deltachat-rpc-client/`
and set line length to 120, same as in `python/`.

Switch from flake8 to ruff.

Fix ruff warnings.
2023-01-20 16:53:21 +00:00
link2xt f4c674fa98 python: set reasonable timeouts for account requests
`requests` library does not have a timeout at all by default.
2023-01-06 11:43:55 +00:00
link2xt 839021f9eb python: enable certificate checks in cloned accounts 2022-08-15 14:40:33 +00:00
link2xt b88042a902 python: display configuration failure error
When configure fails, display error comment in pytest failure message.
2022-06-20 12:39:39 +00:00
adbenitez a96a4362cd add missing Message API 2022-06-10 07:57:17 -04:00
Asiel Díaz Benítez 4f02c811a3 update python API (#3394) 2022-06-04 18:12:38 +02:00
adbenitez 17aab01eaa apply black with new line-length == 120 2022-05-31 23:05:20 -04:00
adbenitez 16e0f0e986 apply isort and black formatters, add format checking to CI 2022-05-29 21:11:49 -04:00
holger krekel cffa101419 remove usage of py in favor of pathlib 2022-05-09 21:22:19 +02:00