froide icon indicating copy to clipboard operation
froide copied to clipboard

Maximum number of messages within timeframe incorrect

Open teriky opened this issue 4 years ago • 3 comments

When sending the 6th message within a timeframe of 24h one got the message "Sie haben die Begrenzung von 6 Anfragen in 6 Stunden überschritten. Dies ist eine automatische Vorsichtsmaßnahme."

This is not correct because the message is displayed after sending 5 messages within 24h: 5 messages sent within 6 hours, the 6th is rejected).

A similar error occures when sending the 8th message within 24 hours (7 messages sent, the 8th is rejected).

teriky avatar Nov 06 '21 21:11 teriky

Sorry, I don't quite understand the issue.

When sending the 6th message within a timeframe of 24h one got the message ... This is not correct because the message is displayed after sending 5 messages within 24h

Is it the 6th or the 5th message? What did you do, what message did you get and what message do you think you should get?

stefanw avatar Nov 07 '21 15:11 stefanw

Steps to reproduce:

  • precondition: no messages sent within the last 24 hours
  • send 5 messages within 1 hour up to 6 hours
  • send the 6th message within the same 1 hour up to 6 hours

Expected behaviour: the 6th message is sent, no hint is displayed

Actual behaviour: the 6th message is not sent, the hint "You have exceeded the limit of 6 requests in 6 hours. This is an automatic precaution." is displayed.

hint message

The same behaviour occurs with the limitation of 8 messages per 24 hours: Only 7 messages within 24 hours can be sent.

As far as I understand is the systems limit defined as sending a maximum of 2 messages within 5 minutes, a maximum of 6 messages within 6 hours, or a maximum of 8 messages per day. Whatever occurs first.

teriky avatar Nov 07 '21 16:11 teriky

I think one confusion point is that there were no distinct throttle messages for sending requests and sending messages in requests. This is fixed.

The throttle configs for requests and messages are distinct and are documented here.

The fail condition is message_count + 1 > fail_count which seems correct to me. I also see you closed your PR again.

There's a basic test for request throttling. Maybe you can come up with a failing test for messages?

stefanw avatar Nov 19 '21 17:11 stefanw