Infiziert90 / SubmarineTracker

Track and Build
MIT License
8 stars 7 forks source link

Dispatch Webhook ignores "Specific Submarines" Notify Setting #12

Closed AlexJLP closed 8 months ago

AlexJLP commented 8 months ago

Assume I have 2 Submersibles, A and B. I enable the Notification Settings -> Webhook for both Dispatch and Return. I also untick "All Returning Subs" and tick A to notify and untick B under "Specific Submarines"

Current Behavior

This may be expected due to the "All Returning Subs" verbiage, but currently: A: Will notify on Dispatch AND Return via webhook. B: Will notify on Dispatch via webhook.

Expected Behavior

A: Will notify on Dispatch AND Return via webhook. B: Will not notify at all via webhook.

Possible Solution

If this is not the intended behaviour, can the setting for specific Submarines be applied to both webhooks; or can a separate setting to be added to filter returning subs?

Workaround would be to just disable dispatch webhooks if the user needs them filtered otherwise.

Possible Implementation

TriggerDispatch does not check Configuration.NotifyForAll and NotifySpecific: https://github.com/Infiziert90/SubmarineTracker/blob/master/SubmarineTracker/Notify.cs#L82-L93 Could add the same and change the verbiage of "All Returning Subs" if this is deemed a valid issue.

Infiziert90 commented 8 months ago

The situation happens because it uses the return code that also the chat uses, while dispatch was newly created for just webhook and I didn't think about the "specific" option

I will fix it in the next update

AlexJLP commented 8 months ago

Appreciate it! Thank you :)