WordPoints / wordpoints

Points plugin for WordPress
GNU General Public License v2.0
20 stars 15 forks source link

Support Rate Limits for non-repeatable events #759

Open JDGrimes opened 6 years ago

JDGrimes commented 6 years ago

This is a follow-up to https://github.com/WordPoints/hooks-api/issues/10.

https://github.com/WordPoints/hooks-api/issues/10#issuecomment-166353137 outlines the technical issues that this presents (related to reversals), which caused us to punt this from the initial version.

The issue is that the event being reversed may have occurred multiple times. The first occurrence would have caused the period to be added to the database, while the later occurrences would be ignored. But we should only remove the period from the database once all of those fires have been reversed.

Feature Request: https://trello.com/c/r3V5ErEo/110-rate-limits-for-all-events

JDGrimes commented 6 years ago

The scenario that we are concerned about is like this:

The expected result would be that they would still get points for that period, because they had still triggered the event with it, they just weren't awarded points for the second post because they had been awarded them for the first.

The current behavior would be that the points would be removed, and the second post wouldn't be taken into account at all.

This is tangentially related to queries and retroactivity, since the retroactive API would probably award points in this case. And using queries would be one possible solution here, I suppose.