Need help understanding INotificationController

Hi all,

I've created a new plugin with the intention of sending notifications to all subscribers of a Gallery app when a new file is uploaded.  The plugin implements IEmailTemplatePreviewPlugin, IEmailNotificationType, ITranslatablePlugin, IConfigurablePlugin.

When the Media.AfterCreate event is called I am getting a list of all subscribed users to the Gallery and adding a notification, like this:

_notificationController.CreateUpdate(new NotificationCreateUpdateOptions
{
    UserId = s.UserId,
    ActorIdToAdd = s.UserId,
    ContentId = e.ContentId,
    ContentTypeId = Apis.Get<IMedia>().ContentTypeId,
    LastUpdate = DateTime.UtcNow
});

This all works fine, but I am finding that each time a new file is added to the Gallery that `GetMessage()` method is being called not for only the current file, but also all of the previously uploaded files.  It is as though it is trying to resent all of the past notifications again.

So I think that I'm not quite understanding what `_notificationController.CreateUpdate()` does, or perhaps I am using it incorrectly.  But ideally I think I would want it to not call `GetMessage()` for all of the previous file additions to the Gallery.

Note that I have also seen some code that calls `_notificationController.Delete()` to delete all past notifications before calling `_notificationController.CreateUpdate()` again.  I understand that it is trying to get around the issue I am having, but is that the correct way to solve this?  And if I do call ` _notificationController.Delete()`, does that cause any race conditions?  For example, if two files are uploaded to the Gallery at the same time, and both cause `_notificationController.Delete()` to be called followed by `_notificationController.CreateUpdate()`, are both sets of notifications guaranteed to be sent, or did is it possible only one of them is sent?

Any advice or insight is welcome.