[AI assisted] MM-63304: Wrap around dqPtr while unmarshalling (#30371)
If the deadQueue was full, we would be incorrectly sending the wrong index for dqPtr. Fixed that and added a test case. https://mattermost.atlassian.net/browse/MM-63304 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7e9cff04c7
Коммит
a5d318cdfb
@@ -156,7 +156,7 @@ func (ps *PlatformService) UnmarshalDQ(buf []json.RawMessage) ([]*model.WebSocke
|
||||
// Same as active queue, this can never be out of bounds because all dead queues
|
||||
// are of deadQueueSize.
|
||||
dq[dqPtr] = item
|
||||
dqPtr++
|
||||
dqPtr = (dqPtr + 1) % deadQueueSize
|
||||
}
|
||||
return dq, dqPtr, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user