If a file gets re-uploaded using the same file name the postfix changes to '-1' on the first re-upload and back to the original file on second re-upload. I would prefer if the file name would stay the same in this condition.
The second issue was with the rich-text field which was still refering to the old filename and URL. I thought the JSON data would only contain the collection name and the document ID but the full data of the media item is stored in MongoDB. This is dangerous and also wastes some space. In order to support any media file changes we have to query the media item anyway and storing an ObjectId would be sufficient. This would prevent other users running into the same issue.
Ideally the depth query parameter should be taken into account for rich-text data as well.