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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: typing a duplicate email in subscribe section #52

Open
2 tasks done
saimaheshtaduri opened this issue Oct 5, 2022 · 5 comments
Open
2 tasks done
Assignees

Comments

@saimaheshtaduri
Copy link

馃摐 Description

When I type a email twice, The second time, its showing Oops! something went wrong. Instead there should be a specific error message like "email already subscibed"

馃憻 Reproduction steps

  1. GO to blog
  2. navigate to the subscribe section
  3. try to give same email twice
  4. the second time, its telling, "something went wrong" instead of "email already exists"

馃憤 Expected behavior

I think, it is better if "email already exists" note arise, when a duplicate email is typed. This makes user understand that he has already subscribed. ( coz first time, I thought the there is network issue and tried disconnecting my internet too )

馃憥 Actual Behavior with Screenshots

Getting "something went wrong" when duplicate email is typed in subscribe section.

馃捇 Operating system

Windows

馃 Node Version

(not applicable )

馃搩 Provide any additional context for the Bug.

No response

馃憖 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Contributing Guidelines?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@scopsy scopsy transferred this issue from novuhq/novu Oct 5, 2022
@nevo-david
Copy link
Contributor

Do you want to work on it @saimaheshtaduri?

@saimaheshtaduri
Copy link
Author

Yes ! @nevo-david

@nevo-david
Copy link
Contributor

Good luck!!! :)

@saimaheshtaduri
Copy link
Author

@nevo-david please review the pr #62

@sachin-duhan
Copy link

In case of duplicates do we get a 302 or relevant status code,
if Yes, then displaying "You are already subscribed" would make sense.

To address internet issue, better option is -

// Online state
const [isOnline, setIsOnline] = useState(navigator.onLine);

useEffect(() => {
    // Update network status
    const handleStatusChange = () => {
      setIsOnline(navigator.onLine);
    };

    // Listen to the online status
    window.addEventListener('online', handleStatusChange);

    // Listen to the offline status
    window.addEventListener('offline', handleStatusChange);

    // Specify how to clean up after this effect for performance improvment
    return () => {
      window.removeEventListener('online', handleStatusChange);
      window.removeEventListener('offline', handleStatusChange);
    };
}, [isOnline]);

in other exceptional cases, we can use a default message - "Internal server error / Something went wrong"

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 a pull request may close this issue.

3 participants