The field 'Name' of Media entity does not change its value after an existing entity got saved (new source file with option "Overwrite original file" unchecked), but preserves its old value (the old file's name) instead. This could be an issue if there is a Media listing page (Views module) with filtration by Name. It will work for the newly added media as the column 'name' within 'media_field_data' table would be exactly the same as 'filename' within 'file_managed' table, but it fails as soon as an entity changes its source file (option "Overwrite original file" unchecked). In this case, only the column 'filename' within 'file_managed' table will be changed.
1. Add new Media item (for example: new file 'test.txt').
2. Check the database tables 'media_field_data' (column 'name') and 'file_managed' (column 'filename') - must have the same filename.
3. Edit the Media from step 1 and change the file. Do not check the option "Overwrite original file".
4. Check again as on step 2 - 'file_managed' (column 'filename') has the new filename, but 'media_field_data' (column 'name') hasn't.
Could use \Drupal\media\Entity\Media::setName()
Needs review
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.