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

fix(tag-selection): fix tag deselection crash in link editing #1813

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ThisChirag
Copy link

Problem

The issue #1810 was marked as resolved but i'm still facing the same issue:
"Removing the only tag during link editing still causes the website to crash."

Solution

This fix ensures:

  • Prevention of invalid states when all tags are removed.

Testing

  • Tested removing all tags and re-adding them.

References #1810

Fixes dubinc#1810: Resolve an issue where removing a tag during link editing caused
the website to crash. This fix prevents invalid states when all tags are deselected.

Tested scenarios:
- Tag removal and re-selection.
- Removing all tags and re-adding.
- No crashes or UI errors when editing links.

Signed-off-by: Chirag Sharma <er.chiragsharma.atemail@gmail.com>
Copy link

vercel bot commented Dec 19, 2024

@ThisChirag is attempting to deploy a commit to the Dub Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Dec 19, 2024

CLA assistant check
All committers have signed the CLA.

@steven-tey
Copy link
Collaborator

Thanks for the PR! Can you outline specific steps for reproducing the original error?

@ThisChirag
Copy link
Author

Thanks for the PR! Can you outline specific steps for reproducing the original error?

Thank you for reviewing the PR. Here's how to reproduce the original error:

  • Open the edit link modal for any existing link that already has at least one tag assigned.
  • Remove all assigned tags by deselecting them, or deselect the only assigned tag.
  • After deselecting all the tags, the website crashes.

Expected Behavior:

  • The tags should be successfully removed.
  • The UI should remain functional, and changes should be saved without issues.

Observed Behavior:

  • The system crashes immediately after deselecting all the tags, causing page to become unresponsive.
  • The crash occurs because the system attempts to process an empty tag state, which results in invalid behavior.

This fix ensures that invalid states (such as an empty tag state) are handled properly, preventing the crash.

Let me know if any specific details are required.
Thank You.

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.

3 participants