Squad-Community-Ban-List icon indicating copy to clipboard operation
Squad-Community-Ban-List copied to clipboard

Ban De-duplication

Open Thomas-Smyth opened this issue 4 years ago • 1 comments

I've noticed that some players have multiple bans from the same ban list in a short period of time. I do not believe that this is an abuse of the system, but I believe it could be:

  • A bug in Battlemetrics that leads to duplicated bans within seconds of each other.
  • and/or two admins issuing a ban on the same player by mistake.
  • and/or modifying the ban by making a new one instead of editing the old one.

For example: https://squad-community-ban-list.com/search/76561198124379883

Though I believe it not to be, others without full context may believe this is an abuse of the system so we should definitely look to fix this.

Idea:

  • Remove the ban saving queue as it did not improve runtime it will make the following harder to achieve.
  • Instead, re-add the ban importing logic to the BanList Sequelize model class.
  • Fetch all bans in the ban list prior to saving them.
  • Remove any bans in the ban list on the same player within x minutes of each other.
  • Save the bans, but instead of doing it one by one as is currently the case we should aim to bulk these queries, e.g. first look for changes in the fields that trigger the player's data to be refreshed and then bulkCreate with an onDuplicateUpdate for all the fields.
  • Import ban list one by one.

Though I said the performance gain for queue saving did not improve runtime, it would be good to find a way to prevent the saving of bans in a ban list from blocking the other ban lists from being fetched, so we are limited less by BM's API rate limit.

Thomas-Smyth avatar Jan 24 '21 20:01 Thomas-Smyth

I may be wrong, but this approach will not filter out all duplicate bans from the same org for a player?

How about the following: Fetch all bans, identify dupes, deselect the entries within dupes leaving only the longest ban duration, and import that. This approach would address your concern, plus would stop any potential deliberate double entry of bans?

basiloriginaluk avatar Apr 03 '21 14:04 basiloriginaluk