test(#265): broaden messaging conformance beyond C7–C14/1:1 (+ fix a .NET pagination bug)#327
Merged
Merged
Conversation
….NET pagination bug) The shared conformance suite covered only C7-C14 on a 1:1 conversation. Extended it (both providers run the identical cases) to close the biggest gaps: - C7 getMessageById (participant reads; outsider gets null) - getProfiles (batch profile lookup) - markAsDelivered (participant sets delivered_at; a non-participant cannot) - C7 pagination (newest-first, cursor + hasMore) - C5 archive/unarchive (per-participant view flag) - C1/C2 group membership scoping (new group conversation + conversation_members in the harness; creator-or-active-member access, outsider excluded) 19 cases per provider (was 12). Full `pnpm test:rls` = 127/127 (both providers + the RLS suite + the #321 backstop). The pagination case caught a REAL .NET provider bug: DotnetMessagingProvider .getMessages returned the raw server JSON as MessagesPage, but the server emits snake_case (has_more), so `hasMore` was `undefined` — pagination would silently break whenever the app runs on the .NET backend. Fixed the provider to map has_more -> hasMore. This is exactly the anti-drift catch the suite exists for. Harness (symmetric in both .supabase + .dotnet runners): added groupConversationId + group seeding, a conversationId param to seedMessage, delivered_at to readMessage, and a readConversation helper. Still out of scope: realtime (C29 - timing/polling non-determinism) and C15-C28 (unallocated rule numbers; materializing them is a design task, not test-writing). Refs #265, #280. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The shared conformance suite (the anti-drift alarm across the Supabase↔.NET seam) covered only C7–C14 on a 1:1 conversation — the honest DoD from #265. This extends it (both providers run the identical cases) to close the biggest gaps, keeping the owner-blocking #280 arc moving.
New cases (12 → 19 per provider)
getMessageById— a participant reads the row; an outsider getsnull.getProfiles— batch display-name/avatar lookup returns the requested users.markAsDelivered— a participant setsdelivered_at; a non-participant outsider cannot.hasMore.conversation_membersin the harness; a member reads it, an outsider gets no metadata and no rows.Full
pnpm test:rls= 127/127 (both providers + the RLS suite + the #321 backstop).Caught + fixed a real bug 🎯
The pagination case exposed a genuine .NET provider bug:
DotnetMessagingProvider.getMessagesreturned the raw server JSON asMessagesPage, but the server serializes with the global snake_case policy, so the flag arrives ashas_more— meaninghasMorewasundefined. Pagination would silently break whenever the app runs on the .NET backend. Fixed the provider to maphas_more→hasMore(the rows are already snake_caseMessageRow, matching the wire). This is exactly the anti-drift catch the suite exists for — the existing tests never checkedhasMore, so it was latent.Harness (symmetric in both runners)
groupConversationId+ group seeding (NULL participants per thecheck_group_participantsconstraint; membership viaconversation_members), aconversationIdparam onseedMessage,delivered_atonreadMessage, and areadConversationhelper.Still out of scope (honest)
Self-validates: the diff touches
tests/contract/**+src/services/messaging/**, both in theConformancegate's path filter, so that gate runs the fulltest:rlsagainst a fresh dual-provider stack.Refs #265, #280.
🤖 Generated with Claude Code