Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary workaround for issue #30 #35

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

Novack
Copy link
Contributor

@Novack Novack commented Dec 8, 2023

Small hack that will prevent notifications to be triggered more than once for the same threadId. Is a temporary workaround for Issue #30, that will offer more time to elaborate on a propper solution for the underlying issue.

@@ -48,6 +48,9 @@ internal void CoreWebView2_WebMessageReceived(object sender, CoreWebView2WebMess
var notificationsPayload = JsonSerializer.Deserialize<NotificationDataWrapper>(receivedMessage.Data.ToString());
foreach (var notification in notificationsPayload.NotificationData)
{
if (_consumedThreads.Contains(notification.ThreadId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be messageID based? you may want notifications for the same threadID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC all our desktop notification actions operate on threadIDs. Based on that, I not even implemented mailID as was not going to have any use, and introduce risk of mistakes. But if we do have it, I can do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, but I see your point on this one. I may want to look into the mailId to hide further notifications rather than the thread. Let me work on it a bit more.

Now the hack works on a per-message basis instead of per thread, so different mails of a thread will still trigger notifications.
@Novack
Copy link
Contributor Author

Novack commented Dec 8, 2023

Oh right, sent the changes. Also added one missing fundamental line, adding the id to the list 🤦‍♂️

Copy link
Contributor

@amilich amilich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@amilich amilich merged commit 1f57076 into skiff-org:main Dec 8, 2023
@amilich
Copy link
Contributor

amilich commented Dec 8, 2023

Just merged it, great fix. I don't have my release computer with signing keys on it until a few days from now, so waiting on that :'(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants