Back up your phone. Then, restore it as new and test. If it works fine, the problem is with your data.
Oh when quit out of all open apps by swiping up? Yea I've done that as well, iPhone 7 plus, I just upgraded was having the same issue with my 6s right before upgrading.
I've restored, and turn phone off and on, but the quit message app? How do I do that?
Assuming that you have a 256 gig iPhone, that's not the problem.
What troubleshooting steps have you already taken? Have you force quit the Messages app? Powered the phone off then on again? Restored from a back up?
How much free space do you have on your device? Settings>General>Storage & iCloud Usage>Storage>Available.
240.9 GB ava
Double tap the Home button. Swipe until you get to the Messages app. Then, flick the window up toward the top of the screen.
Which model phone do you have?
My iPhone Deleting messages immediately