WIP: feat: stateless sync and orphan all sync tokens #1456

Closed
gamesguru wants to merge 188 commits from gamesguru/continuwuity:guru/experiment/stateless-sync-purge-sync-tokens into main

2026-03-04

fix(cli): uwu enable SIGINT (Ctrl+C) mid-command
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Complement Tests / complement-tests (pull_request) Failing after 32s
Update flake hashes / update-flake-hashes (pull_request) Successful in 30s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m12s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 1h0m0s
2026-03-04 19:59:55 -05:00
squash! fix: add outlier rescue admin commands; CONTROVERSIAL is_historical for prev_events soft-failing
enhance the `debug rescue-pdu` command with various useful filtering parameters
2026-03-04 18:17:05 -05:00
chore: bump version (0.6.6-beta.stateless)
fix: revert .0 suffix from stateless version bump

Revert "fix: revert .0 suffix from stateless version bump"

This reverts commit 646be79a6d67477f04b0d7b6fc9d17c9b3d65f35.

fix: change to 0.5.6-beta.stateless.0 per user request
2026-03-04 13:08:10 -05:00
Merge remote-tracking branch 'origin/main' into guru/nightly
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	bin/complement
#	complement/complement.config.toml
#	src/core/error/mod.rs
#	src/service/media/remote.rs
#	src/service/sending/sender.rs
#	src/service/users/mod.rs
2026-03-04 12:53:50 -05:00

2026-03-03

fix: restrict startup presence reset to local users
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 21s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m54s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 22m58s
2026-03-03 01:43:26 -05:00

2026-03-02

fix: race condition associated with log spam: "user joined since last sync"
```log
2026-03-03T02:36:25.790498Z  INFO conduwuit_api::client::sync::v3::joined: user joined since last sync: last_sync_end_shortstatehash=Some(3316807), membership=Some(RoomMemberEventContent { avatar_url: Some("mxc://mdev.nutra.tk/Pb87ocP5NsGs7xvS9ZbIDhI30aU7EZLO"), displayname: Some("ggdev 🏴🚩"), is_direct: None, membership: "leave", third_party_invite: None, blurhash: None, reason: None, join_authorized_via_users_server: None, redact_events: None })
```
2026-03-02 21:36:37 -05:00

2026-03-01

fix: include outlier PDUs in state resolution to fix partially-loaded member lists
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 22s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m23s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 20m6s
2026-03-01 09:36:14 -05:00
perf: use wide_ methods to parallelize server discovery and remote PDU fetching
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 49s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m0s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 20m45s
2026-03-01 08:48:53 -05:00
fix: lint warning on main to appease clippy
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m39s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 25m32s
2026-03-01 06:36:10 -05:00
fix: missing m.room.create outliers causing a sea of Empty rooms and Version 1 errors
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 23s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 37m37s
2026-03-01 06:20:00 -05:00
feat(media): add config to enable missing legacy media endpoints
update config key descriptions in config/mod.rs

add speculative fixes for the following 404 ORB errors in SchildiChat web:

    {"errcode":"M_NOT_FOUND","error":"M_NOT_FOUND: Fetching media failed: Answer from matrix.sp-codes.de: [404 / M_UNRECOGNIZED] Unrecognized request mxc=mxc://matrix.sp-codes.de/SpHUPhCGRnsYTFlyRYCDZhDD authenticated=true"}

    {"errcode":"M_NOT_FOUND","error":"M_NOT_FOUND: Fetching media failed: Answer from hampai.ch: [401 / M_UNAUTHORIZED] no auth provided (required) mxc=mxc://hampai.ch/b291e6908914b64277b7ed0e1de87df5d52cac241958243044855644160 authenticated=true"}

enforce freeze_legacy_media on all legacy remote fetch paths

fix: fallback to unauthenticated media on more errors and safely return NotFound for empty media
2026-03-01 02:41:58 -05:00

2026-02-28

2026-02-27

changes to refactor it again, more
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Update flake hashes / update-flake-hashes (pull_request) Successful in 22s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 3m3s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 19m3s
2026-02-27 08:46:16 -05:00

2026-02-25

allow DELETE, fix 400 error (want 401), see below:
This error occurred fairly early in the Complement logs:

```log
=== NAME  TestDeviceManagement/DELETE_/device/{deviceId}
    apidoc_device_management_test.go:134: MatchResponse got status 400 want 401 - http://127.0.0.1:32820/_matrix/client/v3/devices/7hTYOfr7hy => {"errcode":"M_NOT_JSON","error":"M_NOT_JSON: Not json."}
=== RUN   TestDeviceManagement/DELETE_/device/{deviceId}_requires_UI_auth_user_to_match_device_owner
```
2026-02-25 06:46:55 -05:00
fix(complement): resolve Docker build context issues for any profile
- .dockerignore: whitelist target/dev-quick/conduwuit and target/latest/conduwuit
- Dockerfile: copy from target/dev-quick/conduwuit (concrete path, no symlink)
- Makefile: pass through PROFILE and include --profile in CARGO_FLAGS override
2026-02-25 05:13:07 -05:00
fix(register): skip token check when open registration is enabled
iterate_tokens() always returns the first-run token during first-run
mode, so the previous fix still caused the RegistrationToken flow to
be offered. Now the iterate_tokens() check is also skipped when
open_registration is explicitly enabled, allowing the code to fall
through to the m.login.dummy flow path.
2026-02-25 05:09:54 -05:00
fix(complement): cp binary to flat path to work around Docker symlink limitation
Docker COPY cannot follow directory symlinks in the build context.
Resolve target/latest to the actual profile dir using readlink,
cp the binary to target/conduwuit-complement (a plain file),
and COPY from that in the Dockerfile.
2026-02-25 04:56:35 -05:00
fix(complement): include --profile in CARGO_FLAGS override, use target/debug/
CARGO_FLAGS default includes --profile, so overriding it requires
including --profile explicitly. Revert Dockerfile to target/debug/
since both dev and dev-quick produce the binary there.
2026-02-25 04:45:16 -05:00
fix(complement): pass PROFILE=dev as Make arg not shell env var
Shell env vars don't override .env file values in sub-make calls.
Make command-line arguments have the highest precedence and correctly
override whatever PROFILE is set in .env.
2026-02-25 04:40:48 -05:00
fix(complement): force PROFILE=dev for docker/complement build
Use PROFILE=dev (matching CI) to ensure binary is in target/debug/
where the Dockerfile expects it. The dev-quick profile doesn't produce
a conduwuit binary in its output directory.
2026-02-25 04:39:17 -05:00
fix(complement): resolve symlink for Docker build context
Docker COPY doesn't follow host symlinks, so target/latest/conduwuit
failed. The Makefile now copies the resolved binary to
target/conduwuit-complement before docker build, and the Dockerfile
copies from that stable non-symlinked path.
2026-02-25 04:37:36 -05:00
fix(complement): copy from target/latest/ so any build profile works
The Dockerfile was hardcoded to target/debug/conduwuit but the Makefile
builds to target/dev-quick/ by default, causing Docker to silently
reuse the old cached binary.

target/latest is a symlink that always points to the last-built profile
directory. Using it means the Dockerfile works correctly regardless of
whether the user built with dev, dev-quick, or release.
2026-02-25 04:35:15 -05:00
fix(complement): use PROFILE=dev and --no-cache for docker/complement target
The Dockerfile copies target/debug/conduwuit, but the Makefile was
building with the default dev-quick profile into target/dev-quick/.
Docker then silently reused the cached old binary.

Use PROFILE=dev to match CI and ensure the binary goes to target/debug/,
and add --no-cache to docker build to force a fresh image.
2026-02-25 04:34:09 -05:00
fix(register): fix 500 error and first-run registration with open registration
Two fixes:

1. Error::Uiaa now maps to StatusCode::UNAUTHORIZED (401) in
   status_code() instead of falling through to the wildcard
   INTERNAL_SERVER_ERROR (500). Fixes issue #1409.

2. When yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse
   is set, first-run mode no longer forces m.login.registration_token.
   Admins that explicitly opted into open registration should get
   m.login.dummy on first-run just like subsequent registrations.
   Fixes Complement TestRegistration failures.

Also adds docker/complement Makefile target for local Complement testing.
2026-02-25 04:31:27 -05:00
fix(complement): bootstrap first admin user to exit first-run mode
During first-run mode, registration requires m.login.registration_token
which Complement cannot supply. The entrypoint now starts conduwuit,
parses the auto-generated token from the welcome banner, registers a
first admin user to exit first-run mode, then lets Complement tests
proceed using m.login.dummy auth.
2026-02-25 04:15:52 -05:00

2026-02-24

feat: stateless sync and orphan all sync tokens
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 5m44s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 31m27s
2026-02-24 03:24:41 -05:00

2026-02-23

feat: implement transactional wrappers around room joins and other key code blocks writing to the database
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 15m40s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 24m23s
edits in join.rs to support better transactions

lint fixes

add a test to ensure the database nested transaction panic works as expected

add news fragment
2026-02-23 06:10:43 -05:00

2026-02-16