aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_internal.lua
Commit message (Collapse)AuthorAgeFilesLines
* mod_storage_internal: Clear archive item count cache after experimental trimKim Alvefur2023-11-261-1/+3
| | | | | | | The previous count would be invalid at this point. Should be possible to math out how many items are left, but this is left as future work.
* mod_storage_internal: Close lazy-loading list abstraction after trimKim Alvefur2023-11-261-0/+6
| | | | Should be done here too.
* mod_storage_internal: Only close lazy-loading list store abstractionsKim Alvefur2023-11-261-1/+3
| | | | | Since datamanager can fall back to the old method of loading the whole list, which wouldn't come with a :close method.
* mod_storage_internal: Close archive list after completion of iterationKim Alvefur2023-11-231-0/+1
| | | | | This closes the two FDs that the random access list abstraction uses, otherwise they are left to the garbage collector.
* mod_storage_internal: Don't report error when attempting to trim empty archiveKim Alvefur2023-10-081-1/+7
| | | | Fixes "Could not delete messages for room 'x': (nil)"
* mod_storage_internal: Fix fast trimming of archive with exactly one itemKim Alvefur2023-09-241-0/+7
| | | | | | | | | This method would previously never delete the first (and only) item since it works out which item should become the first item after the trim operation, which doesn't make sense when all should be removed. This also works as an optimization for when all the last item should be trimmed, thus items should be removed.
* mod_storage_internal: Use integer option method for cache sizeKim Alvefur2023-07-181-1/+1
| | | | Missed this one in previous sweep
* plugins: Use integer config API with interval specification where sensibleKim Alvefur2023-07-171-1/+1
| | | | | | | Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff
* mod_storage_internal: Implement efficient deletion of oldest archive itemsKim Alvefur2023-07-121-0/+22
| | | | | | | | Using the new shift function in datamanager, either the oldest items are removed or all the later items are moved into a new file that replaces the old. Hidden behind a feature flag for now.
* mod_storage_internal: Use a binary search for time based rangesKim Alvefur2021-05-121-8/+55
| | | | | | | | | Iterating over an entire archive to find a few items in the far end from where iteration started is expensive, and probably more expensive with the lazy-loading of items added in the previous commit. Since we can now efficiently read items in random order, we can now use a binary search to find a better starting point for iteration.
* mod_storage_internal: Lazy-load archive items while iteratingKim Alvefur2021-05-121-59/+57
| | | | | | | | | | Very large list files previously ran into limits of the Lua parser, or just caused Prosody to freeze while parsing. Using the new index we can parse individual items one at a time. This probably won't reduce overall CPU usage, probably the opposite, but it will reduce the number of items in memory at once and allow collection of items after we iterated past them.
* plugins: Prefix module imports with prosody namespaceKim Alvefur2023-03-241-9/+9
|
* mod_storage_internal: Stop storing XEP-0091 timestampKim Alvefur2021-09-041-2/+1
| | | | | | | Should no longer be used by anything since the conversion of mod_offline to the archive API in 0.10.0, which was 4 years ago. The line clearing the property is left for a bit longer in case someone has very old offline messages or archived data.
* mod_storage_internal: Support query for set of IDsKim Alvefur2021-01-121-0/+8
| | | | Based on implementation in mod_storage_memory
* mod_storage_internal: Add support for full ID range queryKim Alvefur2021-01-121-2/+5
| | | | Based on the mod_storage_memory implementation
* mod_storage_internal, mod_storage_memory: Add support for query.beforeMatthew Wild2020-06-121-2/+6
| | | | Previously returned all results.
* Merge 0.11->trunkKim Alvefur2020-05-151-2/+4
|\
| * mod_storage_internal: Fix error in time limited queries on items without ↵Kim Alvefur2020-05-151-2/+4
| | | | | | | | 'when' field, fixes #1557
* | mod_storage_internal: Fix keeping old timestamp in archive map APIKim Alvefur2020-05-151-1/+1
| | | | | | | | | | This led to a missing 'when' field on changed items, which would cause a traceack.
* | mod_storage_internal: Implement key-value APIKim Alvefur2020-05-111-0/+40
| |
* | mod_storage_internal: Include last text messageKim Alvefur2019-08-231-1/+4
| | | | | | | | | | | | A protocol built on this API now allows showing a list of unread conversations with a counter, ordered by either oldest or newest message, along with the text body itself.
* | mod_storage_*: Also include timestmap of first message in :summary APIKim Alvefur2019-08-231-0/+5
| | | | | | | | | | For completeness along with most recent timestamp. Might be nice to be able to order by oldest unread message.
* | mod_storage_*: Include timestamp of latest message in :summary APIKim Alvefur2019-08-231-1/+4
| | | | | | | | | | | | | | Clients may want to show a list of conversations ordered by how timestamp of most recent message. The counts allow a badge with unread message counter.
* | mod_storage_*: Tweak :summary API to allow future expansion with more fieldsKim Alvefur2019-08-231-3/+5
| | | | | | | | Eg might want to include last message, timestamp, chat state or other info.
* | mod_storage_internal: Return appropriate error even with empty archiveKim Alvefur2019-05-051-0/+3
| |
* | mod_storage_internal: Return error if 'before' or 'after' are not found ↵Kim Alvefur2019-03-051-0/+10
| | | | | | | | (partial fix for #1325)
* | mod_storage_internal: Add support for iterating over users in archive storesKim Alvefur2019-05-051-0/+4
| | | | | | | | May help with writing a better migrator
* | mod_storage_internal,memory: Only return total count if requestedKim Alvefur2019-05-051-6/+11
| |
* | mod_storage_internal: Implement a summary API returning message counts per ↵Kim Alvefur2019-02-251-0/+10
| | | | | | | | contact
* | mod_storage_internal: Include store name when reporting quota statusKim Alvefur2019-03-221-1/+1
| |
* | mod_storage_internal: Increase default quota to 10 000Kim Alvefur2019-03-221-1/+1
| | | | | | | | | | | | Performance doesn't seem great but 10k should be far enough from limits inherited by the Lua parser. 1000 messages seemed pretty close to what an active user might produce in one week.
* | mod_storage_internal,_sql: Key item count cache on both username and storeKim Alvefur2019-03-221-8/+11
| |
* | mod_storage_internal,_sql: Expose archive capabilities feature setKim Alvefur2019-03-221-0/+6
| | | | | | | | This was planned to be added long ago but was forgotten.
* | mod_storage_internal,_sql: Add limit to number of items in an archive store ↵Matthew Wild2017-10-201-0/+35
|/ | | | (fixes #733)
* mod_storage_internal: Only apply truncate if there are more items than requestedKim Alvefur2018-08-041-1/+1
|
* mod_storage_internal: Skip write if no items matched a deletion queryKim Alvefur2017-11-191-0/+3
|
* mod_storage_internal: Optimize truncationKim Alvefur2017-11-101-4/+5
|
* mod_storage_internal: Allow truncating deletion at the beginning or end of ↵Kim Alvefur2017-11-091-0/+15
| | | | an archive store
* mod_storage_internal: Add more extensive query support to archive:delete methodKim Alvefur2017-10-091-6/+22
|
* mod_storage_internal: Add support for archive key deduplication (like ↵Kim Alvefur2017-10-091-2/+21
| | | | mod_storage_sql)
* mod_storage_internal: Return a noop iterator if archive is empty (fixes #920)Kim Alvefur2017-07-051-1/+7
|
* mod_storage_internal: Handle case of empty item store when deleting (fixes #910)Kim Alvefur2017-05-141-1/+7
|
* mod_storage_internal: Correctly calculate number of deleted items (fixes #912)Kim Alvefur2017-05-141-1/+2
|
* mod_storage_internal: Support the 'key' archive query fieldKim Alvefur2017-04-151-0/+5
|
* mod_storage_internal: Add the dates methodKim Alvefur2017-03-311-0/+6
|
* mod_storage_internal: Add support for removing archived itemsKim Alvefur2017-03-311-0/+19
|
* mod_storage_internal: Add basic archive store implementationKim Alvefur2017-03-311-0/+85
|
* mod_storage_internal: Ignore unused 'self' argument [luacheck]Kim Alvefur2017-03-311-2/+2
|
* mod_storage_internal: Reorder methodsKim Alvefur2017-03-311-8/+8
|
* mod_storage_internal: Separate driver from keyval implementationKim Alvefur2017-03-311-6/+10
|