-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/delete messages upto 24 hrs #945
Feat/delete messages upto 24 hrs #945
Conversation
Couple of things to work atm:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please dont forget to also update the PP.md
file. We must inform users about how we store their data.
.../src/main/java/org/togetherjava/tjbot/features/moderation/history/MessageHistoryRoutine.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/togetherjava/tjbot/features/moderation/history/MessageHistoryRoutine.java
Outdated
Show resolved
Hide resolved
...cation/src/main/java/org/togetherjava/tjbot/features/moderation/history/MessageListener.java
Outdated
Show resolved
Hide resolved
...cation/src/main/java/org/togetherjava/tjbot/features/moderation/history/MessageListener.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeHistoryCommand.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeHistoryCommand.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeHistoryCommand.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeHistoryCommand.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeHistoryCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/features/moderation/history/package-info.java
Outdated
Show resolved
Hide resolved
Ah, good. Perhaps tweak this paragraph:
(added |
Atm duration is optional (default is 1hr) but if provided can be entered from 1-24 as value. I was thinking perhaps a better way would be to provide choices such as |
...n/src/main/java/org/togetherjava/tjbot/features/moderation/history/PurgeMessageListener.java
Outdated
Show resolved
Hide resolved
@@ -58,7 +58,7 @@ private void updateHistory(MessageReceivedEvent event) { | |||
|
|||
incrementRecordsCounter(); | |||
} else { | |||
logger.warn("purge history reached limit"); | |||
logger.debug("purge history reached limit"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the log would be more useful if it also gives a suggestion how to fix the problem.
"Purge History reached limit. Either delete some rows of the table or wait for them to expire."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually i think i might have a better idea, Imagine the DB is maxed out with 7.5k messages. No more records are being saved, which means any new spam messages would be ignored and using purge-in-channel
would only delete older messages which might not be the best thing . Ideally i think we should keep the messages from newest to oldest upto the "max limit".
Possible Solution:
Let's say we have a limit 7.5k, we hit a mark of 7.4k. A routine should be trigged that only clears out last 500 records or so. This way all the new messages are being tracked and command is not useless past the limit. Thoughts ?
@Zabuzard @Tais993 @Taz03 Context:
It become problematic when someone in future adds a new option in Point is numbers can change with time and i wanna make sure both the classes are on same page when it comes to this duration limit. I decided to move constants to a different class Current:
Possibly newer changes:Add
|
* enum will hold duration constants for feature * tiny fixes in message for user of command * hrs-> hr for single message and in x hrs -> within x hrs
This feature has reached it's final stage and is now open for reviews. |
First draft of feature, delete messages upto 24 hrs in same channel.
Additions:
command interface:
when there's no records:
if there's any records within selected duration:
Note: Duration is optional, if skipped it defaults to last hour.