openfire-monitoring-plugin
openfire-monitoring-plugin copied to clipboard
Should not wait forever to answer a request for future archive
When a MAM request is performed, Openfire will wait until data has been persisted into the database, before the answer is calculated from database content. For that, it compares the potential 'date until' from the request against what's already written. When the client requests a time range that's far into the future, this might cause Openfire to wait until that time before an answer is generated.
It's likely most suitable to return a result that include all messages that have been archived up until that time, plus a bit of grace (for example, by using the timestamp of when the request was received when the time that's requested in the request is in the future).
It won't wait forever at the moment, but it will once this TODO is completed: https://github.com/igniterealtime/openfire-monitoring-plugin/blob/b3fed324aaad06646292e5eb0805340c5e212a5d/src/java/com/reucon/openfire/plugin/archive/xep0313/IQQueryHandler.java#L239