Privacy policy: the forum, and the export and retention it states

Both languages: rows for the forum profile, posts, last visit, private
conversations, reports and the moderation log (DSA legal obligation);
what is public and what moderators see; forum content never goes to AI;
retention periods; the forum theme cookie; the rights (the export covers
the forum, posts kept as "Törölt tag" can be deleted on request). In
force from 2026-11-26.

So that it holds: the account export includes the forum, and the hourly
cleanup clears text removed by moderators after a year, closed reports
and old ban reasons after a year, the moderation log after two years,
and requests never accepted after 90 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 11:26:09 +00:00
co-authored by Claude Opus 5.5
parent da42c92e71
commit 88d9a5df3e
8 changed files with 290 additions and 16 deletions
+36
View File
@@ -1024,12 +1024,39 @@ async fn export_and_delete_account(pool: PgPool) {
assert_eq!(r.status, StatusCode::CREATED, "{}", r.body);
let r = app.post("/v1/synastries", Some(&anna), json!({"chart1_id": b["id"], "chart2_id": a["id"]})).await;
assert_eq!(r.status, StatusCode::OK); // already exists
// Anna also wrote in the forum (services/forum keeps it in the same database).
let (anna_id,): (uuid::Uuid,) =
sqlx::query_as("SELECT id FROM users WHERE email = 'anna@example.com'").fetch_one(&app.pool).await.unwrap();
sqlx::query(
"INSERT INTO forum.members (user_id, nickname, nickname_key, avatar) \
VALUES ($1, 'Holdfény', 'holdfeny', 'hold-ejkek')",
)
.bind(anna_id)
.execute(&app.pool)
.await
.unwrap();
let thread: i64 = sqlx::query_scalar(
"INSERT INTO forum.threads (topic_id, author_id, title) VALUES (4, $1, 'Téli levesek') RETURNING id",
)
.bind(anna_id)
.fetch_one(&app.pool)
.await
.unwrap();
sqlx::query("INSERT INTO forum.posts (thread_id, author_id, is_opening, body) VALUES ($1, $2, true, 'Sütőtök')")
.bind(thread)
.bind(anna_id)
.execute(&app.pool)
.await
.unwrap();
let r = app.get("/v1/me/export", Some(&anna)).await;
assert_eq!(r.status, StatusCode::OK);
assert_eq!(r.body["charts"].as_array().unwrap().len(), 2);
assert_eq!(r.body["synastries"].as_array().unwrap().len(), 1);
assert!(r.body["login_methods"][0].get("password_hash").is_none());
assert_eq!(r.body["forum_profile"][0]["nickname"], "Holdfény");
assert_eq!(r.body["forum_posts"][0]["body"], "Sütőtök");
assert_eq!(r.body["forum_posts"][0]["thread_title"], "Téli levesek");
let r = app.call("DELETE", "/v1/me", Some(&anna), Some(json!({"confirm": "yes"}))).await;
assert_eq!(r.status, StatusCode::BAD_REQUEST);
@@ -1041,6 +1068,15 @@ async fn export_and_delete_account(pool: PgPool) {
assert_eq!(r.status, StatusCode::UNAUTHORIZED);
let (left,): (i64,) = sqlx::query_as("SELECT count(*) FROM charts").fetch_one(&app.pool).await.unwrap();
assert_eq!(left, 0);
// Her forum profile is gone; her thread stays, by "Törölt tag" (no author).
let (members, author): (i64, Option<uuid::Uuid>) = sqlx::query_as(
"SELECT (SELECT count(*) FROM forum.members), (SELECT author_id FROM forum.threads WHERE id = $1)",
)
.bind(thread)
.fetch_one(&app.pool)
.await
.unwrap();
assert_eq!((members, author), (0, None));
assert_eq!(app.get("/v1/me", Some(&bela)).await.status, StatusCode::OK);
}