How our first bug report was about our sign up page being broken

Just an hour ago, our first bug report came in. It was about our signup page being broken. The signup page being broken!!!

First, we checked whether or not he checked all the boxes, if his input was in correct form and other possible issues that might bring up such an error message. But his format was correct. He checked all the boxes and we found no other issues.

Then it struck me! What’s about ReCaptcha? That’s part of our backend validation. After some back and forth, we found out that it was indeed missing. How could that be? We checked everything from network logs to our API keys, but everything was loaded correctly.

I enabled full logging on our dev instance and still, no value for the gcaptcha field. That’s when I started analyzing the client-side code. Something must prevent ReCaptcha from setting the required value and… hurray! I’ve found something.

The code listened on the so called onsubmit event of the form which was set by looking for a form element with the ID gcaptcha. In another script, the same event was set for a seemingly different form which indeed pointed to the same element as originally intended. It just looked like a different element, because it was written as “give me the parent of this submit button”, which is the form.

I combined both events into one and our sign up page was brought back to life. The whole process from bug report to fix deployed on all servers took about 30 minutes.

tl;dr: A logic error in the client-side code prevented ReCaptcha from executing.

Thanks to @goldgamer for reaching out to us! :partying_face:

1 Like

You’re welcome!! :slight_smile: :grin:🥸

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.