Skip to content

fix(integrations): redeliver Slack content after blind events#163

Merged
khaliqgant merged 2 commits into
mainfrom
fix/slack-blind-replay-dedupe
Jun 8, 2026
Merged

fix(integrations): redeliver Slack content after blind events#163
khaliqgant merged 2 commits into
mainfrom
fix/slack-blind-replay-dedupe

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

  • allow the first content-bearing Slack replay after an earlier blind Message: unavailable delivery
  • keep subsequent alias/retry copies deduped by recording the content hash
  • add regression coverage for the reported Slack thread-reply path shape

Validation

  • node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.ts (71/71 pass in source worktree)
  • node --experimental-strip-types --no-warnings --test --test-name-pattern 'slack blind thread-reply delivery does not suppress a later content-bearing replay|slack context does not inject sparse relayfile pointer fallback as message content|slack unchanged-content replay is suppressed after injected delivery commits' src/main/__tests__/integration-event-bridge.test.ts (3/3 pass in source worktree)\n\n## Notes\n- This is the Pear bridge follow-on to the relayfile mount read-not-ready retry fix.\n- No cloud-side change is required for this incident.

@codeant-ai

codeant-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 47 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0c12664-ef2c-4fa7-b35e-5290c2464766

📥 Commits

Reviewing files that changed from the base of the PR and between 2de4e87 and 3e560ef.

📒 Files selected for processing (2)
  • src/main/__tests__/integration-event-bridge.test.ts
  • src/main/integration-event-bridge.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/slack-blind-replay-dedupe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

You’re at about 93% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Re-trigger cubic

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the deduplication logic in IntegrationEventBridge to allow the first content-bearing replay of a blind claim to go through, and adds a corresponding integration test. The reviewer identified a critical lifecycle bug where the blind event's success or failure could prematurely commit or accidentally release the provisional content hashes of in-flight replays, potentially causing permanent suppression or duplicate deliveries. To resolve this, the reviewer recommends decoupling the blind event's lifecycle from the content hashes in commitDedupeKey and releaseDedupeKey.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +2979 to +2982
if (provisional) existing.provisionalContentHashes.add(contentHash)
else existing.committedContentHashes.add(contentHash)
existing.expiresAt = now + ttlMs
return { claimed: false }
return { claimed: true, contentHash }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Critical Deduplication Lifecycle Bug

While letting the first content-bearing replay through (claimed: true) is correct, it introduces a critical bug in how commitDedupeKey and releaseDedupeKey manage the lifecycle of provisionalContentHashes and committedContentHashes.

In the previous implementation, content-bearing replays were suppressed/dropped immediately, so their hashes were "learned" but they never had independent delivery lifecycles. Now that they are actually delivered, they have their own independent success/failure lifecycles.

Because of this, the blind event's commit/release lifecycle should no longer touch the content hashes:

  1. Premature Commit Bug: If the blind event succeeds, commitDedupeKey currently moves all provisionalContentHashes to committedContentHashes. If an in-flight content-bearing replay subsequently fails, releaseDedupeKey won't be able to release its hash because it has already been committed. This results in the message being permanently suppressed and unable to be retried.
  2. Accidental Release Bug: If the blind event fails, releaseDedupeKey currently clears provisionalContentHashes. This wipes out the hashes of any in-flight content-bearing replays, meaning they will never be committed even if they succeed, allowing duplicate replays to bypass deduplication.

Recommended Fix

To resolve this, update commitDedupeKey and releaseDedupeKey (located further down in this file) so that the blind event's lifecycle only manages the blind flags and does not touch the content hashes:

// In commitDedupeKey (around line 3026):
    } else if (entry.provisionalBlind) {
      entry.provisionalBlind = false
      entry.committedBlind = true
      // Remove the loop moving provisionalContentHashes to committedContentHashes
    }
// In releaseDedupeKey (around line 3070):
      } else {
        entry.provisionalBlind = false
        // Remove entry.provisionalContentHashes.clear()
      }

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #163 against .workforce/pr.diff, changed files, and context. I found no reproducible breakage in the current checkout, so I did not make code edits.

Addressed comments

  • No bot/reviewer comments were available in this checkout: .workforce contains only pr.diff, changed-files.txt, and context.json.

Validation run:

  • node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.ts passed: 71/71
  • npm test passed: 102/102

I did not verify GitHub CI status or mergeability from GitHub, per the “don’t use git or gh CLI” instruction.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@codeant-ai

codeant-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@khaliqgant

Copy link
Copy Markdown
Member Author

Addressed the Gemini lifecycle finding in 3e560ef.

What changed:

  • Blind Slack dedupe commits now only move provisionalBlind -> committedBlind.
  • Blind Slack dedupe releases now only clear provisionalBlind.
  • Blind commit/release no longer commits or clears provisional content hashes owned by in-flight content-bearing replays.

Regression coverage added:

  • slack blind commit does not commit an in-flight content-bearing replay hash
  • slack blind release does not release an in-flight content-bearing replay hash

These cover the two failure classes Gemini flagged:

  • blind success cannot permanently suppress a content replay whose injected delivery later fails
  • blind failure cannot release an in-flight content replay and allow duplicate sends before that replay settles

Validation:

  • node --experimental-strip-types --no-warnings --test --test-name-pattern 'slack blind' src/main/__tests__/integration-event-bridge.test.ts => 3/3 pass
  • node --experimental-strip-types --no-warnings --test --test-name-pattern 'slack blind|slack unchanged-content replay is suppressed after injected delivery commits|content-present slack replay waits|slack context does not inject sparse relayfile pointer fallback as message content' src/main/__tests__/integration-event-bridge.test.ts => 6/6 pass
  • node --experimental-strip-types --no-warnings --test src/main/__tests__/integration-event-bridge.test.ts => 73/73 pass
  • npm test => 104/104 pass

Devin note:

  • GitHub only exposes Devin Review as “No Issues Found” plus a link saying there are 2 app-only findings.
  • I attempted to open https://app.devin.ai/review/agentworkforce/pear/pull/163, but the unauthenticated response is just the Devin app shell and the findings are not available via the GitHub PR API. I could not inspect those two app-only findings from this session. If someone with Devin app access can paste them here or into the PR, I’ll address them directly.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Reviewed PR #163 against the diff and current checkout. I did not make edits: Gemini’s actionable finding is already fixed in the current code, and the regression tests are present.

Validation run:
npm test -- src/main/__tests__/integration-event-bridge.test.ts passed, 104/104 tests.

GitHub API status at final poll:
cubic · AI code reviewer success, checks success, packaged-mcp-smoke still in_progress. PR is mergeable but mergeable_state is unstable because a check is still running, so I am not printing READY.

Addressed comments

  • gemini-code-assist[bot]: raised the blind dedupe lifecycle bug where blind commit/release could commit or clear in-flight content hashes. Stale, already handled in current checkout: blind commit only updates blind flags in src/main/integration-event-bridge.ts:3026; blind release only clears provisionalBlind in src/main/integration-event-bridge.ts:3066; regression coverage in src/main/__tests__/integration-event-bridge.test.ts:1692 and src/main/__tests__/integration-event-bridge.test.ts:1761.
  • cubic-dev-ai[bot]: reported no issues found. No code change needed.
  • devin-ai-integration[bot]: reported no GitHub-visible issues found; referenced 2 app-only findings not exposed through the PR API. No code change possible from the current accessible data.
  • codeant-ai[bot]: posted review-limit messages only. No actionable code finding.
  • coderabbitai[bot]: posted review-rate-limit/usage messages only. No actionable code finding.
  • agent-relay-code[bot]: earlier comment said no review comments were available in checkout. Stale because GitHub API now exposes the Gemini comment; no code change needed beyond the already-present fix above.
  • khaliqgant: stated Gemini lifecycle finding was addressed in 3e560ef with regression tests. Confirmed in current checkout at src/main/integration-event-bridge.ts:3026, src/main/integration-event-bridge.ts:3066, and tests starting src/main/__tests__/integration-event-bridge.test.ts:1692.

@khaliqgant khaliqgant merged commit de9d547 into main Jun 8, 2026
4 checks passed
@khaliqgant khaliqgant deleted the fix/slack-blind-replay-dedupe branch June 8, 2026 11:24
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