No internet connection
  1. Home
  2. Issues

TalkYard rejects email with + character

By Michael Lynch @michael
    2023-06-26 23:51:23.445Z

    A blog reader reported that when they try to sign up for TalkYard using a + in their email, TalkYard responds with:

    Weird email. Please use a real email address [TyE04HK83]

    I tried and was able to reproduce this by trying to sign up with the email test+talkyard@example.com.

    A + character is valid in email addresses, and many users use them for mail filtering rules (e.g., mike+talkyard@example.com, mike+discourse@example.com both go to mike@example.com but the + suffix lets me add metadata about the sender).

    Additionally, the error message is kind of user-hostile, as the wording suggests the user is deliberately using a fake email address rather than suggesting that they made a mistake. Could the user-facing message just be "Invalid email"?

    On the same note, the input fields are a bit user-hostile as well. They tell the user that their email address is invalid before they even have a chance to finish entering it. Could the check be deferred to the blur event rather than checking in the middle of the user typing?

    • 6 replies
    1. About +: Oh yes it's a valid char, I guess I don't know about that back then (when I wrote that code), or I was sleepy. Fixing in the upcoming version.

      About the error messages: Ok I'll change to "Invalid email" or sth like that. (Hmm yes "Please use a real ..." sounds a bit odd, now when I think about it.)

      They tell the user that their email address is invalid before they even have a chance to finish entering it [..] blur event [...]

      That's a good idea.
      Hmm, I think some errors can be shown directly, namely if typing an invalid / unsupported character in the email address (then that's likely a typo, and one would want to hit Backspace directly).
      While other errors can wait until blur. Or maybe if the user is away / inactive for fairly long — so they sees when back that "oh I wasn't done typing the email", hmm.

      Thanks for the video

      1. In reply tomichael:

        This has been fixed now (I should add auto tests too)

        1. Michael Lynch @michael
            2023-07-17 22:39:05.545Z

            I think there's been a regression. I tried verifying the fix, and now the submit button is completely disabled, so users can't sign up at all:

            1. I couldn't reproduce, not yet at least. This happens if you, in the comments section, click Log In above the comments, and then switch to guest login by clicking just type a name?

              If I do that, then the Submit button is first disabled, however once I type two characters in the Name field (min length) it gets enabled.

              The email address: When I test (over at mtlynch.io) the Submit button is enabled if there's no email specified, or if it's valid (and +something works fine).

              (If I click Reply, type a comment and then "Post reply" and log in after composing, then the Submit button is enabled directly. A bit inconsistent)

              Can I post test comment(s) over at your blog? What blog post page did you test from?

              (What do you use for recording screencasts?)

              I tried in Chrome and FF Private Browsing. There aren't any browser plugins activated in FF Private Browsing?
              You don't happen to have kept an old browser page open, for long, > a week or so? But I don't see how that could matter, since the login popup gets loaded right now from the server.

              1. Michael Lynch @michael
                  2023-07-18 11:24:33.693Z

                  I was trying on Firefox 114. I did an update to Firefox 115, and it went away. That probably didn't make a difference, but maybe it knocked something out of cache?

                  When it was failing, this error popped up in the JS console:

                  Uncaught (in promise) Error: Minified React error #200; visit https://reactjs.org/docs/error-decoder.html?invariant=200 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
                      render https://c1.ty-cdn.net/-/assets/v0.2023.008/slim-bundle.min.js:10
                      startMainReactRoot https://c1.ty-cdn.net/-/assets/v0.2023.008/slim-bundle.min.js:10
                      renderPageInBrowser https://c1.ty-cdn.net/-/assets/v0.2023.008/slim-bundle.min.js:10
                  

                  But now the issue is gone, and I've confirmed your fix. Thanks!

                  1. Ok :- )

                    (The browser cache? yes maybe, hmm, at the same time, the JS & CSS links use asset versioning ... Except for /-/blog-comments.min.js which instead has a pretty short cache time, but it's not used in the login popup, hmm, oh well.)

                    Thanks for the error log message — it looks harmless, & I added a note about removing it. (Seems as if Ty looks for somewhere to render a page, but that won't work in the login popup.)

            2. Progress
              with handling this problem
            3. @KajMagnus marked this topic as Started 2023-06-27 14:22:09.383Z.
            4. @KajMagnus marked this topic as Done 2023-07-25 08:09:00.162Z.