We have a small need to have a real-time or near-real-time communication tool integrated into our app - and it seems there’s a chance the user inbox add-on could be modified to be “good enough.” I haven’t delved into it yet, but I’m curious by what mechanism the “new messages” indicator gets updated, and if that could be altered to be near real-time?
Because of US medical info privacy laws, having a chat (or close to “chat”) capability built into our app would be incredibly useful - and since this add-on already has the ability to reference entities it would be a good fit.
in general it should be possible to use the addon as a chat functionality. The UI might not be very well tailored ATM for the regular chat UI, but you can extend that on your own.
It really depends on the amount of chat data that you expect. The addon currently misses the concept of a “thread” that is perhaps needed for a chat like use-case (not sure).
Regarding the “x new” message on the Main Screen - it does basically polling on the DB. If you make the sampling rate to high, it will probably hit your DB, depending on the number of concurrent users. So, in this case, it might be work to introduce some kind of caching on the front-end servers.
I just saw the count query fetches the not only the receiver, but also the read column - which is currently not indexed :-/
Please try it and put it under load and get back to me with the results. Most likely there is a lot to performance tune there
Why don’t use the global event to trigger the action for getting message count ?
Publish a “MessageSent” event after called an API for sending message. On web layer, process the event , find whether there are active AppUI for receiver ,if yes,then update the UI.
switching from polling to push notification should also be possible. I think back then global-events addon was not there. In case the non-functional requirements would be of that kind that polling is not sufficient anymore, then it would probably be the right choice. But for the normal case of Inbox, I think polling is just fine.