{"record":{"id":"af0c7265abc8f02e","repo":"redis/go-redis","slug":"redis-channelwithsubscriptions-can-t-be-called-af","errorCode":null,"errorMessage":"redis: ChannelWithSubscriptions can't be called after Channel","messagePattern":"redis: ChannelWithSubscriptions can't be called after Channel","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pubsub.go","lineNumber":603,"sourceCode":"// with specified buffer size.\n//\n// Deprecated: use Channel(WithChannelSize(size)), remove in v9.\nfunc (c *PubSub) ChannelSize(size int) <-chan *Message {\n\treturn c.Channel(WithChannelSize(size))\n}\n\n// ChannelWithSubscriptions is like Channel, but message type can be either\n// *Subscription or *Message. Subscription messages can be used to detect\n// reconnections.\n//\n// ChannelWithSubscriptions can not be used together with Channel or ChannelSize.\nfunc (c *PubSub) ChannelWithSubscriptions(opts ...ChannelOption) <-chan interface{} {\n\tc.chOnce.Do(func() {\n\t\tc.allCh = newChannel(c, opts...)\n\t\tc.allCh.initAllChan()\n\t})\n\tif c.allCh == nil {\n\t\terr := fmt.Errorf(\"redis: ChannelWithSubscriptions can't be called after Channel\")\n\t\tpanic(err)\n\t}\n\treturn c.allCh.allCh\n}\n\nfunc (c *PubSub) processPendingPushNotificationWithReader(ctx context.Context, cn *pool.Conn, rd *proto.Reader) error {\n\t// Only process push notifications for RESP3 connections with a processor\n\tif c.opt.Protocol != 3 || c.pushProcessor == nil {\n\t\treturn nil\n\t}\n\n\t// Create handler context with client, connection pool, and connection information\n\thandlerCtx := c.pushNotificationHandlerContext(cn)\n\treturn c.pushProcessor.ProcessPendingNotifications(ctx, handlerCtx, rd)\n}\n\nfunc (c *PubSub) pushNotificationHandlerContext(cn *pool.Conn) push.NotificationHandlerContext {\n\t// PubSub doesn't have a client or connection pool, so we pass nil for those","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/pubsub.go#L585-L621","documentation":"Error \"redis: ChannelWithSubscriptions can't be called after Channel\" thrown in redis/go-redis.","triggerScenarios":"Thrown at pubsub.go:603 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}