You need to tell us with clients and if possible which server. It should usually not happen, but some outdated clients do exhibit similar issues.
XMPP
XMPP (aka Jabber) is the community-owned standard for real-time federated messaging.
JoinJabber.org admin support chat
On the office laptop an my PC (both running artix gnu+linux) I'm using dino and on the phone (lineageos for microg) I'm using conversations.
You could try to see if your account settings are defaulting to message archiving. In Gajim for example you can do that under Accounts Menu -> Advanced -> Archiving Preferences
Dino neither Conversations offer anything about archiving preferences.
Not sure about Dino, but in Conversations it should be in your account details, top right three dot menu, then archive settings as always.
archiving preferences -> Server-side archiving preferences?
- Never
- Contacts
- Always Is that the one? Setting it to Always would help? Is this the one?
And on the dino side, on preferences there's almost nothing to configure, and on acocunts, I see nothing that can be configured. I can only add/remove accounts...
"Always" is the good choice yes, and dino is gnome-philosophy-compliant: "do not expose too many settings".
Some additional info: your server admin may have set the server-side archiving policy to a very short time or even disabled it all together. Also, this Conversations setting only applies to direct chats. For groups it's up to the group owner to enable or disable server-side archiving (it's on by default in most modern implementations).