I have checked the setting and it is and has always been set to forever when it comes to settings-messages-message history. Yet since I upgraded to ios 18.1, my messages have started to delete by themselves every other day or so. In the last week, I have had to go into the recently deleted and recovered the messages at least 3-4 times. It does not delete all my messages just random messages from whom I have messaged recently. I have message that have been there for at least 6 years and those are not deleting. Please help before I lose some valuable messages.
Iphone is deleting my messages automatically
Welcome to the forum.
Your question is not about app development. So you'd better ask on Apple Support Community: https://discussions.apple.com/welcome
Or file a bug report here: https://feedbackassistant.apple.com and provide as miuch information as possible on your iPhone configuration.