Sentinel History Rewrite #81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/history-rewrite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request completely rewrites Sentinel's history method, pulling it out of
SentinelCogand into its ownviews.historymodule. Closes #78.The new API can be accessed at
tidegear.sentinel.HistoryView.This also includes changes to Tidegear's emoji system, but they're internal and shouldn't qualify as a breaking change (only private attributes / methods were changed in an incompatible way).
The new history system works as such:
HistoryView.send()with their filters._HistoryOptsobject, which ties intoSentinelCogmethods to actually fetch moderations.<pagesize>moderations that satisfy the given filters, and one to count the number of rows that satisfy the given filters. ThisCOUNTquery is not repeated again in normal usage._HistoryOptsobject are hydrated with the query results. This is then used to compute the total number of pages for the given<pagesize>.<pagesize>, pagination buttons will be available.Next/Backuse keyset pagination, whereasFirst/Last/Jump to Pageuse offset pagination.Next/Backwill be much faster as databases grow in row count, but for realistic usage, offset pagination is probably fine, and it'd be prohibitively difficult to implement keyset pagination for those other buttons.Not including message sending, the new system is about 412x or 99.76% faster than the legacy history method.
Old:
New:
seconds_to_millisecondsutility function; add proper logging calls forsentinel_historyand_sentinel_history_count; improve logging calls in_sentinel_expiry_handlerHistoryView._send_opts()9b88b804d8HistoryViewmenu fixesJump to Page01ddb4cd6aHistoryViewtimeout behavior; fix_HistoryPageModalbugsentinel_history_menumethodWIP: Sentinel History Rewriteto Sentinel History Rewrite