Skip to content

Conversation

@softins
Copy link
Member

@softins softins commented Mar 16, 2022

Short description of changes

Start or restart the message ack timer every time a protocol message is sent, so that the ack timeout
works correctly at all times.

CHANGELOG: Client/Server: corrected operation of message ack timer.

Context: Fixes an issue?

The original code only started the timer if it was not already active. This failed to restart the ack timer for each sent message. The timer is a free-running repeated timer, so this meant that if a lot of messages were queued up at once (such as from a MIDI controller, see #2492, and second bullet point in #2492 (comment)), the timer only got started for the first message, and fired every 400ms while the queue was not empty. So later messages sent from the queue could be considered prematurely unacked every 400ms from the sending of the first message, and re-sent unnecessarily. QTimer::start() will restart a running timer, so is safe to call without checking for active.

Does this change need documentation? What needs to be documented and how?

No, bug fix only.

Status of this Pull Request

Tested. Packet trace from master showed frequent repeated messages. Packet trace from this branch did not.

What is missing until this pull request can be merged?

Ready to merge

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@softins softins changed the title Restart ACK timer every time a packet is sent Restart ACK timer every time a message is sent Mar 16, 2022
@softins
Copy link
Member Author

softins commented Mar 16, 2022

Second reviewer please merge. Thanks!

Copy link
Member

@hoffie hoffie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! :)

@hoffie hoffie added this to the Release 3.9.0 milestone Mar 16, 2022
@hoffie hoffie merged commit 405bee4 into jamulussoftware:master Mar 16, 2022
@softins softins deleted the protocol-timer branch August 30, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants