Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#174 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
mobile-dev

Research direction

Start with Toasts.Forms.Plugin.Droid/ToastNotification.cs at Notify and CancelAllDelivered, then inspect SnackbarNotification.cs around line 34 and ToastClosed. Reproduce or reason about concurrent Notify calls and dismissal callbacks. Done means repeated or concurrent notifications no longer cause a duplicate-key exception while delivered notifications can still be cancelled.

Written by the indexing model from the issue text.

Description

Good day!

Version: 3.3.2
Exception: System.ArgumentException: 'The key already existed in the dictionary.' from SnackbarNotification.
Stack trace:
IDictionary<TKey,TValue>.Add (TKey key, TValue value) SnackbarNotification.ToastClosed (System.String id, Plugin.Toasts.NotificationResult result) SnackbarNotification.<Notify>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 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 method.

Dominant language
C#
Stars
275
Forks
81
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EgorBo/Toasts.Forms.Plugin

All issues in EgorBo/Toasts.Forms.Plugin

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.