codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
375 stars 70 forks source link

Subscribing from a subscription error page produces a 404 #1351

Open cellio opened 1 month ago

cellio commented 1 month ago

meta:290808

Steps to reproduce:

  1. In the "subscribe by email" section (right column), click on "all new questions".
  2. Submit the form without filling anything out. You'll get an error.
  3. On that page, in the "subscribe by email" section, click on "all new questions" again and this time provide a frequency.
  4. 404 (and the subscription is saved).

I suspect that we are redirecting back to where you were before you clicked on the form -- which is usually correct, but in this case you were on an error page (/subscriptions/new), which you only reach via the form. (If you go there manually it's a 404.)

It would be better to detect that the "return to" page isn't valid and fall back to a page that works. We probably don't know where the person was two steps ago (before getting the error), but the community's landing page or the user's subscriptions list would both be better than a 404.