NOJIRA-Retire-contact-interactions-proxy-via-peer-events - #1137
Merged
Conversation
…a peer_events Retire bin-contact-manager's self-owned CRM interaction pipeline (contact_interactions/contact_resolutions write path, get-by-id, resolution create/delete, unresolved queue) and proxy the surviving InteractionList RPC through bin-timeline-manager's peer_events read API instead. Design doc: bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md - bin-common-handler: keep ContactV1InteractionList wrapper, now returning peer_events-shaped response; delete ContactV1InteractionGet/ListUnresolved/ResolutionCreate/Delete wrappers and their RequestHandler interface entries and mocks - bin-contact-manager: delete EventCallCreated/EventConversationMessageCreated (CRM eligibility filter + projection write path), ResolutionCreate/Delete, InteractionGet, InteractionListUnresolved, and their listenhandler RPC routes and dispatch entries - bin-contact-manager: rewrite InteractionList to proxy bin-timeline-manager's peer_events read API via TimelineV1PeerEventList, supporting peer_type+peer_target/contact_id/address_id filters and rejecting unfiltered/since-only queries; returns []*peerevent.PeerEvent unmodified (no field reshaping) - bin-contact-manager: delete call-manager/conversation-manager event subscriptions (callmanager.go/conversationmanager.go) and their queue bindings, now unused
…er_events response schema for List
- bin-openapi-manager: delete unresolved/{id}/resolutions POST+DELETE path
files for both /contact_interactions and /service_agents/contact_interactions
(8 files total) and their paths: registrations in openapi.yaml
- bin-openapi-manager: repoint the surviving List paths' response schema
from ContactManagerInteractionListResponse to
TimelineManagerPeerEventListResponse, matching contact-manager's
InteractionList RPC now returning peerevent.PeerEvent unmodified
(design doc §8.1/§9)
- bin-openapi-manager: delete ContactManagerInteraction,
ContactManagerInteractionListResponse, ContactManagerResolution schemas
(no remaining references after the above)
… proxy List via peer_events - bin-api-manager: Trim server/contact_interactions.go and server/service_agents_contact_interactions.go to keep only the List handler; delete Unresolved/Id GET/Resolutions POST/DELETE handlers - bin-api-manager: Trim pkg/servicehandler/interaction.go and serviceagent_interaction.go to keep only InteractionList/ServiceAgentInteractionList, returning peer_events (peerevent.PeerEvent) unmodified - bin-api-manager: Update ServiceHandler interface and regenerate mock_main.go - bin-api-manager: Rewrite interaction_test.go, serviceagent_interaction_test.go, contact_interactions_test.go, service_agents_contact_interactions_test.go for the surviving List functions against the peer_events response shape - bin-api-manager: Regenerate gens/openapi_redoc and gens/openapi_server from the updated bin-openapi-manager spec
- bin-ai-manager: toolHandleGetContactInteractions consumes bin-common-handler's ContactV1InteractionList peer_events response ([]*peerevent.PeerEvent) instead of the retired interaction.Interaction shape; rename .TMInteraction->.Timestamp (non-pointer) and .ReferenceType->.Publisher, keep .Direction/.Peer.Type/.Peer.Target/.ReferenceID - bin-ai-manager: update tool_insight_test.go fixtures to build tmpeerevent.PeerEvent responses instead of cminteraction.Interaction
…rement - bin-api-manager: contact_peer_event_overview.rst no longer describes GET /contact_interactions as an identity-resolved/CRM-filtered alternative to GET /contact_peer_events; both now return the same raw, unfiltered response shape. contact_interactions is documented as legacy-compatibility-only (kept for existing callers, plus its address_id filter), with contact_peer_events recommended for new integrations - bin-api-manager: rebuild docsdev HTML
PR #1137 round 2 review findings. - bin-contact-manager: InteractionList's contact_id filter mode now returns a distinct CONTACT_HAS_NO_ADDRESSES error instead of the generic INVALID_FILTER when a valid contact_id is supplied but the contact has zero registered addresses (previously indistinguishable from the no-filter-at-all case) - bin-contact-manager: add test coverage for contact-with-no-addresses and RPC-error-propagation on InteractionList - bin-api-manager: add RPC-error-propagation test coverage to InteractionList and ServiceAgentInteractionList servicehandler tests
pchero
added a commit
that referenced
this pull request
Jul 24, 2026
Follow-up cleanup for PR #1137 (contact_interactions -> peer_events retirement, design doc bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md). That PR cleaned the handler/RPC/subscription layers; this removes what design doc §2.4/§3.6 explicitly deferred to a follow-up -- the now-unreachable models/dbhandler layer and the underlying MySQL tables. - bin-contact-manager: delete models/interaction, models/resolution packages entirely - bin-contact-manager: delete pkg/dbhandler/interaction.go (Create/Get/List/ListByOwnershipPeriods/ListByIDs/ListUnresolved) and resolution.go (Create/CreateTx/Delete/ListByInteraction/ListByContact) - bin-contact-manager: delete pkg/dbhandler/address_ownership_read.go's OwnershipPeriodsListByContactID/MissingPeriodOwnedAddresses -- existed solely to support the old InteractionList's ownership-period matching; the write path (OwnershipPeriodsLockAndResolveTx, used by live Address CRUD) is untouched - bin-contact-manager: remove the 9 corresponding DBHandler interface methods, regenerate mocks - bin-contact-manager: rewrite pkg/casehandler/casenote_isolation_test.go for the post-PR-#1137 world -- InteractionList no longer queries any local table, so the isolation guarantee is now structural (CaseNoteCreate must never call any RequestHandler RPC, proven via gomock strict mode on a RequestHandler mock with zero EXPECT() calls configured) - bin-contact-manager: drop the SQLite contact_interactions/contact_resolutions test-fixture tables from scripts/database_scripts_test/contacts.sql - bin-dbscheme-manager: add migration d8b04ef3ddd0 dropping the contact_interactions/contact_resolutions MySQL tables in production. contact_address_ownership_periods is explicitly NOT touched -- still live, used by Address CRUD independent of Interaction
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.
Retire bin-contact-manager's self-owned CRM interaction pipeline (contact_interactions/contact_resolutions write path, get-by-id, resolution create/delete, unresolved queue) and proxy the surviving InteractionList RPC/REST path through bin-timeline-manager's peer_events read API instead. Design doc: bin-contact-manager/docs/plans/2026-07-25-contact-interaction-retire-to-peer-events-design.md (§1-§9, 9 rounds of prior review + 3 rounds of implementation review to follow).