Any reason not to accumulate these IDs into a list and then do updateMessagesMetaData on the list?