@@ -37,15 +37,6 @@ type prContext struct {
3737 Number int
3838}
3939
40- // ThreadInfo is an alias to cache.ThreadInfo for backward compatibility.
41- type ThreadInfo = cache.ThreadInfo
42-
43- // ThreadCache is an alias to cache.ThreadCache for backward compatibility.
44- type ThreadCache = cache.ThreadCache
45-
46- // CommitPRCache is an alias to cache.CommitPRCache for backward compatibility.
47- type CommitPRCache = cache.CommitPRCache
48-
4940// Coordinator coordinates between GitHub, Slack, and notifications for a single org.
5041//
5142//nolint:govet // Field order optimized for logical grouping over memory alignment
@@ -59,15 +50,15 @@ type Coordinator struct {
5950 configManager ConfigManager
6051 notifier * notify.Manager
6152 userMapper UserMapper
62- threadCache * ThreadCache // In-memory cache for fast lookups
63- commitPRCache * CommitPRCache // Maps commit SHAs to PR numbers for check events
64- eventSemaphore chan struct {} // Limits concurrent event processing (prevents overwhelming APIs)
53+ threadCache * cache. ThreadCache // In-memory cache for fast lookups
54+ commitPRCache * cache. CommitPRCache // Maps commit SHAs to PR numbers for check events
55+ eventSemaphore chan struct {} // Limits concurrent event processing (prevents overwhelming APIs)
6556}
6657
6758// StateStore interface for persistent state - allows dependency injection for testing.
6859type StateStore interface {
69- Thread (owner , repo string , number int , channelID string ) (ThreadInfo , bool )
70- SaveThread (owner , repo string , number int , channelID string , info ThreadInfo ) error
60+ Thread (owner , repo string , number int , channelID string ) (cache. ThreadInfo , bool )
61+ SaveThread (owner , repo string , number int , channelID string , info cache. ThreadInfo ) error
7162 LastDM (userID , prURL string ) (time.Time , bool )
7263 RecordDM (userID , prURL string , sentAt time.Time ) error
7364 ListDMUsers (prURL string ) []string
@@ -127,7 +118,7 @@ func New(
127118
128119// saveThread persists thread info to both cache and persistent storage.
129120// This ensures threads survive restarts and are available for closed PR updates.
130- func (c * Coordinator ) saveThread (owner , repo string , number int , channelID string , info ThreadInfo ) {
121+ func (c * Coordinator ) saveThread (owner , repo string , number int , channelID string , info cache. ThreadInfo ) {
131122 // Save to in-memory cache for fast lookups
132123 key := fmt .Sprintf ("%s/%s#%d:%s" , owner , repo , number , channelID )
133124 c .threadCache .Set (key , info )
@@ -205,7 +196,7 @@ func (c *Coordinator) findOrCreatePRThread(ctx context.Context, channelID, owner
205196 "current_message_preview" , initialSearchText [:min (100 , len (initialSearchText ))])
206197
207198 // Save the found thread (cache + persist)
208- c .saveThread (owner , repo , prNumber , channelID , ThreadInfo {
199+ c .saveThread (owner , repo , prNumber , channelID , cache. ThreadInfo {
209200 ThreadTS : initialSearchTS ,
210201 ChannelID : channelID ,
211202 LastState : prState ,
@@ -248,7 +239,7 @@ func (c *Coordinator) findOrCreatePRThread(ctx context.Context, channelID, owner
248239 // Try to take over creation
249240 if ! c .threadCache .MarkCreating (cacheKey ) {
250241 // Still being created, give up
251- return "" , false , "" , fmt . Errorf ("timed out waiting for thread creation" )
242+ return "" , false , "" , errors . New ("timed out waiting for thread creation" )
252243 }
253244 }
254245 }
@@ -281,7 +272,7 @@ func (c *Coordinator) findOrCreatePRThread(ctx context.Context, channelID, owner
281272 "note" , "this prevented duplicate thread creation during rolling deployment" )
282273
283274 // Save it and return (cache + persist)
284- c .saveThread (owner , repo , prNumber , channelID , ThreadInfo {
275+ c .saveThread (owner , repo , prNumber , channelID , cache. ThreadInfo {
285276 ThreadTS : crossInstanceCheckTS ,
286277 ChannelID : channelID ,
287278 LastState : prState ,
@@ -304,7 +295,7 @@ func (c *Coordinator) findOrCreatePRThread(ctx context.Context, channelID, owner
304295 }
305296
306297 // Save the new thread (cache + persist)
307- c .saveThread (owner , repo , prNumber , channelID , ThreadInfo {
298+ c .saveThread (owner , repo , prNumber , channelID , cache. ThreadInfo {
308299 ThreadTS : newThreadTS ,
309300 ChannelID : channelID ,
310301 LastState : prState ,
@@ -1394,7 +1385,7 @@ func (c *Coordinator) processPRForChannel(
13941385 "next_poll_in" , "5m" )
13951386 } else {
13961387 // Save updated thread info (cache + persist)
1397- c .saveThread (owner , repo , prNumber , channelID , ThreadInfo {
1388+ c .saveThread (owner , repo , prNumber , channelID , cache. ThreadInfo {
13981389 ThreadTS : threadTS ,
13991390 ChannelID : channelID ,
14001391 LastState : prState ,
0 commit comments