Skip to content

fix: Fix toast identity race handling#31

Open
the-asad-iqbal wants to merge 1 commit intohiaaryan:mainfrom
the-asad-iqbal:main
Open

fix: Fix toast identity race handling#31
the-asad-iqbal wants to merge 1 commit intohiaaryan:mainfrom
the-asad-iqbal:main

Conversation

@the-asad-iqbal
Copy link
Copy Markdown

This PR fixes two high-severity toast identity issues:

  • Unnamed toasts now get unique generated ids instead of sharing a constant default id.
  • Dismiss now targets the exact (id, instanceId) pair, so delayed removal cannot delete a newer toast with the same id.

Changes

  • Updated toast creation to use a unique id when id is not provided.
  • Updated dismiss flow to:
    • capture the current instanceId
    • mark exiting only for that specific instance
    • remove only that specific instance after exit timeout

Result

  • Multiple unnamed toasts no longer overwrite each other.
  • Recreated toasts with the same id are safe from stale dismiss timers.

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.

1 participant