Skip to content

feat(messaging): integrate updated chat protos with data layer and tests#976

Merged
bmc08gt merged 7 commits into
code/cashfrom
feat/update-protos-chat
Jun 24, 2026
Merged

feat(messaging): integrate updated chat protos with data layer and tests#976
bmc08gt merged 7 commits into
code/cashfrom
feat/update-protos-chat

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator
  • Update flipcash protobuf definitions with new chat RPCs and message content types (Deleted, Media, Reply,
    System)
  • Scaffold service stubs for the new RPCs
  • Wire proto changes through the data layer — new MessageContent variants, MediaId/MediaItem/MediaMetadata models, reaction summaries, and event-based chat updates
  • Add gap-aware event sequence tracking for reliable delta sync over the chat event stream
  • Add test coverage for event sequencing, reactions, and serialization

bmc08gt added 5 commits June 24, 2026 13:02
New Messaging RPCs: GetDelta, EditMessage, DeleteMessage, AddReaction,
RemoveReaction, GetReactors, GetReactionSummary, GetReactionSummaries.

New content types: ReplyContent, MediaContent, SystemContent, DeletedContent.
New models: Event, Mutation, EventBatch, ReactionSummary, EmojiReaction,
ReactionUpdate, Emoji, Reactor, MediaItem, MediaMetadata, MediaId.

ChatUpdate.new_messages deprecated in favor of EventBatch events.
Message gains last_edited_ts, event_sequence, reactions fields.
Metadata gains latest_event_sequence field.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Full Api → Service → Repository → Controller scaffolding for:
GetDelta, EditMessage, DeleteMessage, AddReaction, RemoveReaction,
GetReactors, GetReactionSummary, GetReactionSummaries.

Domain model updates:
- ChatMetadata: +latestEventSequence
- ChatMessage: +lastEditedTs, eventSequence, reactions
- MessageContent: +Reply, Media, System, Deleted subtypes
- ChatUpdate: +events, reactionUpdates (newMessages deprecated)
- New models: Emoji, Reactor, EmojiReaction, ReactionSummary,
  ReactionUpdate, MediaId, MediaItem, MediaMetadata, ChatEvent,
  ChatMutation

Mapper updates for all new proto→domain and domain→proto conversions.
8 new error sealed classes matching proto response result enums.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Add Room columns for eventSequence, lastEditedTs, reactions on
ChatMessageEntity and latestEventSequence on ChatMetadataEntity
(migration 20→21). ChatCoordinator now prefers ChatUpdate.events
over deprecated newMessages, supports delta-based catch-up on
reconnect via getDelta, and maintains an in-memory reaction overlay
from reactionUpdates. DAO upsert guards against stale writes using
event sequence LWW.

Add TODOs for UI handling

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Replace naive max-sequence cursor advancement with a contiguous-
frontier tracker. Out-of-order events are held in a pending set;
only the highest gapless sequence is persisted. If a gap is not
filled within 2s, getDelta backfills from the frontier. Prevents
permanently skipping events on reordered delivery, critical for
large group chats.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
…rialization

EventSequenceTrackerTest (14): gap detection, contiguous advancement,
out-of-order handling, resetTo, multi-chat isolation.
ChatCoordinatorEventsTest (10): events-vs-newMessages preference,
gap-aware cursor, reaction overlay LWW guard and pruning.
ChatTypeConvertersTest (12): ReactionSummary round-trip, nulls,
plus MessageContent/Status/UserProfile converters.
@bmc08gt bmc08gt self-assigned this Jun 24, 2026
@github-actions github-actions Bot added type: feature New functionality area: network gRPC, connectivity, API, exchange rates labels Jun 24, 2026
bmc08gt added 2 commits June 24, 2026 14:24
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Cover editMessage, deleteMessage, addReaction, removeReaction,
getReactors, getReactionSummary, getReactionSummaries, and getDelta
with no-account-cluster, parameter-forwarding, and result-surfacing
tests. Wire up FakeChatMessagingRepository with tracked state for all
new repository methods.
@bmc08gt bmc08gt merged commit 807acdd into code/cash Jun 24, 2026
3 checks passed
@bmc08gt bmc08gt deleted the feat/update-protos-chat branch June 24, 2026 23:08
bmc08gt added a commit that referenced this pull request Jun 24, 2026
…inator-delegates

* origin/code/cash:
  feat(messaging): integrate updated chat protos with data layer and tests (#976)
  fix(streaming): stop reporting retryable ClosedSendChannelException to Bugsnag (#978)
  build: update release manifest

# Conflicts:
#	apps/flipcash/shared/chat/src/main/kotlin/com/flipcash/shared/chat/ChatCoordinator.kt
#	apps/flipcash/shared/chat/src/test/kotlin/com/flipcash/shared/chat/ChatCoordinatorEventsTest.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant