MCPcopy Index your code
hub / github.com/coder/coder / applyChatLifecycleTransition

Method applyChatLifecycleTransition

coderd/x/chatd/chatd.go:2344–2358  ·  view source on GitHub ↗
(
	ctx context.Context,
	chatID uuid.UUID,
	action string,
	kind codersdk.ChatWatchEventKind,
	transition func(context.Context, uuid.UUID) ([]database.Chat, error),
)

Source from the content-addressed store, hash-verified

2342}
2343
2344func (p *Server) applyChatLifecycleTransition(
2345 ctx context.Context,
2346 chatID uuid.UUID,
2347 action string,
2348 kind codersdk.ChatWatchEventKind,
2349 transition func(context.Context, uuid.UUID) ([]database.Chat, error),
2350) error {
2351 updatedChats, err := transition(ctx, chatID)
2352 if err != nil {
2353 return xerrors.Errorf("%s chat: %w", action, err)
2354 }
2355
2356 p.publishChatPubsubEvents(updatedChats, kind)
2357 return nil
2358}
2359
2360// DeleteQueued removes a queued user message and publishes the queue update.
2361func (p *Server) DeleteQueued(

Callers 1

UnarchiveChatMethod · 0.95

Calls 3

transitionStruct · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected