Skip to content

conversation_detail_provider_selection_test fails on main — the different-days guard is red #10976

Closed

Description

@mdmohsin7

Symptom

app/test/providers/conversation_detail_provider_selection_test.dart — "conversation getter resolves when startedAt and createdAt fall on different days" — fails on a clean main (verified at 6c4d752b2f, run 2026-08-01):

Expected: not null
  Actual: <null>
test/providers/conversation_detail_provider_selection_test.dart 48:5  main.<fn>

The other two tests in the file pass. It is the only failure in the suite (957 pass, 1 fail).

Why it matters

The test guards a real invariant, stated in its own comment: a session spanning midnight (or a timezone edge) must still resolve through ConversationDetailProvider.conversation instead of throwing from the non-null getter. conversationOrNull coming back null means updateConversation(id, groupDate) no longer finds the conversation via the group key the list item passes on tap.

Likely cause

The fixture pins absolute dates:

startedAt: DateTime.utc(2026, 7, 18, 23, 30),
createdAt: DateTime.utc(2026, 7, 19, 0, 15),

Written around 2026-07-18, passing then, failing now — so something in grouping or lookup depends on the conversation's age relative to today. groupedConversations.keys.single still resolves, so the grouping produces a key; the lookup against it is what fails.

Two things to settle: whether the production path is actually broken for older conversations, or only the fixture has rotted — and either way the fixture should be relative to a fixed injected clock so it cannot rot again.

Noticed while running the suite for an unrelated sync change; not caused by it (reproduced on unmodified main).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions