Repository navigation
refactor(slack): consolidate deferred ingress settlement - #130367
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Exact-head landing verification: Replace three handwritten deferred promises with the existing SDK primitive. Keep distinct session-handoff and channel-migration fences; one adoption flag and one terminal abort callback own settlement. Production +20/-52 (−32); tests unchanged. 57 tests use actual Bolt App and on-disk SQLite ingress, same-session FIFO, independent sessions, migration, watchdog, cancellation and restart. Five doctor contract tests and the complete matching-dependency changed gate pass; fresh P1 and independent exact-head source review pass. Hosted CI is green for 7195da4. Best-fix judgment: A single combined latch would incorrectly release channel migration at reply handoff. Existing SDK deferred helper is the canonical primitive; no new abstraction is necessary. Limitations: This is behavior-preserving library/filesystem integration, not a new authenticated Slack Desktop run; Slack wire behavior is unchanged. Latest available ClawSweeper comment is a review-start placeholder, without an actionable rank-up list; independent final-source review is complete. No new config, dependency, protocol or database schema is introduced. |
|
Merged via squash.
|
What Problem This Solves
Slack's deferred ingress used three handwritten promise factories and overlapping completion flags to express the same lifecycle. That duplication made it harder to verify the crucial distinction between session ordering and channel-ID migration fencing after #114552.
Why This Change Was Made
Reuse the existing Plugin SDK deferred primitive, already used by Slack slash dispatch. One adoption-pending fact replaces overlapping flags; one terminal abort callback releases both latches and removes itself. Keep the latches separate: reply handoff releases session ordering, while adoption, abandonment, or abort releases the channel migration fence. Do not merge those ownership boundaries.
Production LOC: +20/-52 (net -32). Tests unchanged. No public SDK, config, database, protocol, dependency, or external Slack API change. This is a maintainer-requested behavior-preserving refactor, not a newly discovered Slack service bug.
User Impact
Independent Slack sessions still run concurrently; same-session turns retain FIFO ordering. Deferred replies do not let channel-ID migration overtake unfinished work. Relay dispatch completion and failure propagation remain unchanged.
Evidence
7195da4af690604c0eecd2a36dcb9f475dd3234d.Promise.allSettled; the shared deferred primitive delegates to nativePromise.withResolvers.Maintainer-requested, AI-assisted. Required exact-head hosted CI and native landing checks remain mandatory.