gotd: ensure user is member of channels before starting getDifference loop

This commit is contained in:
Tulir Asokan
2025-12-12 15:45:39 +02:00
parent c1d92ce051
commit ba4dd48d5a
8 changed files with 88 additions and 31 deletions
+6 -5
View File
@@ -62,11 +62,8 @@ type internalState struct {
}
type stateConfig struct {
State State
Channels map[int64]struct {
Pts int
AccessHash int64
}
State State
Channels map[int64]PtsAccessHashTuple
RawClient API
Logger *zap.Logger
Tracer trace.Tracer
@@ -422,6 +419,10 @@ func (s *internalState) createAndRunChannelState(ctx context.Context, channelID,
s.channelsLock.Unlock()
s.log.Info("Removed channel state due to error", zap.Int64("channel_id", channelID), zap.Error(err))
return nil
} else if ctx.Err() == nil {
s.log.Error("Channel state stopped with unexpected error, new messages may stop arriving",
zap.Int64("channel_id", channelID), zap.Error(err))
return nil
}
return err
})