Duplicated bubbles came from the cubit emitting every inbox event to the screen regardless of whether it was already shown. On opening a chat the saved message loads from history AND the live subscription hands back the same stored gift wrap the relay re-delivers — two bubbles. (The store was already idempotent, but the cubit ignored that for display.) MessagesCubit now keeps a seen-set (sender+timestamp+text): a re-delivered or already-loaded message is skipped, and pre-existing duplicates in old saved history collapse on load too. Arrival order preserved (no resort). Tests: re-delivered wrap shown once; history-raced-by-live shown once. |
||
|---|---|---|
| .. | ||
| inventory_cubit_test.dart | ||
| messages_cubit_test.dart | ||
| offers_cubit_test.dart | ||
| quick_add_cubit_test.dart | ||
| trust_cubit_test.dart | ||
| variety_detail_cubit_test.dart | ||