Skip to content

fix(slack-gateway): preserve channel conversation continuity#215

Merged
onutc merged 7 commits intomainfrom
fix-slack-channel-conversation-continuity
Apr 8, 2026
Merged

fix(slack-gateway): preserve channel conversation continuity#215
onutc merged 7 commits intomainfrom
fix-slack-channel-conversation-continuity

Conversation

@onutc
Copy link
Copy Markdown
Member

@onutc onutc commented Apr 8, 2026

TL;DR

Shared Slack channel conversations now migrate from the old per-message or per-thread IDs to a stable channel-scoped identity without forking existing room state. The API lazily reuses legacy channel conversations on the first post-deploy message, persists the canonical channel ID as an alias, and keeps reply threading behavior unchanged.

Summary

  • key shared-channel Slack gateway upserts by channel ID and send legacy lookup IDs during cutover
  • reuse lone legacy base-route conversations when the current Slack message ID does not match the old stored thread/root ID
  • backfill canonical aliases and missing base-route labels during lazy migration
  • cover channel migration, ambiguity, and alias persistence cases in API and Slack gateway tests

Review Focus

  • channel conversation reuse rules during the Slack cutover
  • ambiguity handling when multiple legacy conversations already exist for the same channel
  • top-level reply alias persistence versus threaded reply behavior

Testing

  • go test ./... (in api)
  • go test ./... (in integrations/slack-gateway)
  • codex review --base main

@onutc
Copy link
Copy Markdown
Member Author

onutc commented Apr 8, 2026

Final validation report

Local validation

  • go test ./... (api): pass
  • go test ./... (integrations/slack-gateway): pass
  • codex review --base main: addressed one P1 cutover regression and one P2 alias-growth issue; no remaining P0/P1 blockers

PR checks

  • tcx pr can-merge --pr 215: CAN MERGE (checks)
  • GitHub checks on 0780af8: all green

Notes

  • This PR now canonicalizes non-DM Slack conversations to channel ID, migrates legacy thread/message identities without forking, and avoids unbounded reply-ts alias growth on active channels.
  • Earlier staging workflow 24163514441 succeeded for commit 3de7da9. The final 0780af8 follow-up was validated locally and in PR CI, but was not rerun through staging before merge.

@onutc onutc merged commit d2de27f into main Apr 8, 2026
7 checks passed
@onutc onutc deleted the fix-slack-channel-conversation-continuity branch April 8, 2026 23:30
@gitrank-connector
Copy link
Copy Markdown

⭐ GitRank PR Analysis

Score: 50 points

Metric Value
Component Other (1× multiplier)
Severity P1 - High (50 base pts)
Final Score 50 × 1 = 50

Eligibility Checks

Check Status
Issue/Bug Fix
Fix Implementation
PR Documented
Tests
Lines Within Limit

Impact Summary

This PR implements a sophisticated migration strategy for Slack shared channel conversations, enabling seamless transition from legacy per-message/per-thread conversation IDs to stable channel-scoped identities. The implementation includes lazy reuse of legacy conversations, canonical alias persistence, and conflict detection to prevent conversation fragmentation during the cutover period. The changes affect 7 files with 1081 lines modified, including comprehensive test coverage for migration scenarios.

Analysis Details

Component Classification: This PR affects the Slack gateway integration and channel conversation service, which don't fit into the predefined component categories. The changes span API business logic, integration layer, and conversation state management, making OTHER the appropriate classification.

Severity Justification: This is a High (P1) severity fix addressing a critical data continuity issue during a production migration. The PR prevents conversation forking and data loss when Slack channels transition from per-message/per-thread identity to channel-scoped identity, which directly impacts user experience and conversation history preservation.

Eligibility Notes: The PR clearly documents a bug fix addressing conversation continuity during Slack gateway migration (issue=true). The implementation aligns with the PR title and description, properly handling legacy lookup IDs and conversation reuse logic (fix_implementation=true). The PR has detailed description with TL;DR, summary, and review focus sections (pr_linked=true). Extensive test coverage added including 665 new test lines covering migration, ambiguity, and alias persistence cases (tests=true). Tests are required because this involves critical business logic changes to conversation identity management and state migration, not just configuration or documentation (tests_required=true).


Analyzed by GitRank 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant