EgorBo / EgorBo/Toasts.Forms.Plugin

System.ArgumentException: The key already existed in the dictionary.

Open
#174 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
275
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Good day!

**Version**: 3.3.2
**Exception**: System.ArgumentException: 'The key already existed in the dictionary.' from SnackbarNotification.
**Stack trace**:
``
IDictionary.Add (TKey key, TValue value)
SnackbarNotification.ToastClosed (System.String id, Plugin.Toasts.NotificationResult result)
SnackbarNotification.b__5_2 (System.String toastId, Plugin.Toasts.NotificationResult result)
ToastCallback.OnDismissed (Android.Support.Design.Widget.Snackbar snackbar, System.Int32 evt)
Snackbar+Callback.n_OnDismissed_Landroid_support_design_widget_Snackbar_I (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_transientBottomBar, System.Int32 e)
``

We call a [Notify](https://github.com/EgorBo/Toasts.Forms.Plugin/blob/8132380da78f34f0b3611f6fe7ef9880a2259a98/Toasts.Forms.Plugin.Droid/ToastNotification.cs#L31) method from ToastNotification class in several threads. I think that we catch a situation when we have the same id on line https://github.com/EgorBo/Toasts.Forms.Plugin/blob/8132380da78f34f0b3611f6fe7ef9880a2259a98/Toasts.Forms.Plugin.Droid/SnackbarNotification.cs#L34 and after that we call [CancelAllDelivered](https://github.com/EgorBo/Toasts.Forms.Plugin/blob/8132380da78f34f0b3611f6fe7ef9880a2259a98/Toasts.Forms.Plugin.Droid/ToastNotification.cs#L62) method.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.