M2: Meili search + saved searches, sync windows + backfill progress, threading & image fixes
Search: - Meilisearch backend (app/search/meili.py) + factory wiring; pinned SDK 2.7 - Search-as-you-type: debounced query + Postgres prefix matching, built from the DB tokenizer so full email addresses match (email stays one lexeme) - Saved searches API + sidebar virtual mailboxes; save affordance in the box Account sync windows (SPEC §12 M2): - Choose at setup: All (recent 30d first, then remainder), Last 3 months, New only - Per-account sync_window + "Sync remaining mail" from settings (idempotent re-run) - Provider windowed backfill (SINCE/BEFORE), message_count, newest_uid - migration 0012: accounts.sync_window + backfill_total/backfill_done Backfill progress UX: - Floating progress card (auto-dissolves after 10s) + spinning sidebar ring that fills with the account colour; driven by sync.progress over WS Thread list pagination: - Server-side offset + accurate grand total, with filter/order in SQL; working prev/next across all synced mail Reading panel: - "Load images" one-off now actually renders images (?images=1) without trusting the sender; envelope carries images_allowed so a trusted sender shows no prompt Threading: - Subject fallback no longer merges messages that declare an explicit (different) parent; true siblings still group via a shared-parent reference match. Fixes unrelated auto-replies with the same subject landing in one thread Backend 257 tests green, ruff + mypy --strict clean; frontend tsc/eslint/vitest clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U72FZiF1W1pb8XxyWBTREA
This commit is contained in:
@@ -72,6 +72,48 @@ async def test_broken_client_subject_only_joins(env: ThreadingEnv) -> None:
|
||||
assert a.thread_id == b.thread_id
|
||||
|
||||
|
||||
async def test_auto_replies_to_different_originals_do_not_join(env: ThreadingEnv) -> None:
|
||||
# Two out-of-office auto-replies, same subject and same recipient, but each
|
||||
# replying to a DIFFERENT (absent) original. They must not be subject-merged.
|
||||
a = await env.add(
|
||||
message_id="autoA@tvp.pl",
|
||||
subject="Automatyczna odpowiedź: Silent Hill",
|
||||
from_email="robert@tvp.pl",
|
||||
to_email="me@gmail.com",
|
||||
in_reply_to="orig1@mail.gmail.com",
|
||||
references=["orig1@mail.gmail.com"],
|
||||
)
|
||||
b = await env.add(
|
||||
message_id="autoB@wfdif.com.pl",
|
||||
subject="Automatyczna odpowiedź: Silent Hill",
|
||||
from_email="dyrektor@wfdif.com.pl",
|
||||
to_email="me@gmail.com",
|
||||
in_reply_to="orig2@mail.gmail.com",
|
||||
references=["orig2@mail.gmail.com"],
|
||||
minutes=5,
|
||||
)
|
||||
assert a.thread_id != b.thread_id
|
||||
|
||||
|
||||
async def test_replies_to_same_absent_parent_join(env: ThreadingEnv) -> None:
|
||||
# Two replies that reference the SAME (absent) original — and not each other —
|
||||
# still thread together via the shared parent reference.
|
||||
a = await env.add(
|
||||
message_id="r1@x.com",
|
||||
subject="Re: Topic",
|
||||
in_reply_to="orig@x.com",
|
||||
references=["orig@x.com"],
|
||||
)
|
||||
b = await env.add(
|
||||
message_id="r2@x.com",
|
||||
subject="Re: Topic",
|
||||
in_reply_to="orig@x.com",
|
||||
references=["orig@x.com"],
|
||||
minutes=3,
|
||||
)
|
||||
assert a.thread_id == b.thread_id
|
||||
|
||||
|
||||
async def test_distinct_topic_same_subject_does_not_join(env: ThreadingEnv) -> None:
|
||||
a = await env.add(
|
||||
message_id="a@x.com",
|
||||
|
||||
Reference in New Issue
Block a user