CodeForPhilly / laddr

http://codeforphilly.github.io/laddr/
MIT License
61 stars 34 forks source link

Users can edit newsletter preferences in their profile #189

Closed APrioriRainbows closed 6 years ago

themightychris commented 6 years ago

This is in testing on cfp but pending merge into laddr

ki9us commented 6 years ago

I uncheck the subscribe button and click save and the box is rechecked on refresh. Feels like the first level of hell.

ki9us commented 6 years ago

talking about production btw

themightychris commented 6 years ago

It's working for me on desktop and mobile chrome, can anyone else reproduce?

@keith24 thanks so much for the report, I suspect you're not the only person who has encountered this. Can you let me know what specific browser and platform you are using?

ki9us commented 6 years ago

Strange. It's chrome 65 for Android. I'm looking at codeforphilly.org/profile. The box rechecks itself no matter which "Save profile" button I tap. Changes to my name, email, or phone are working fine.

themightychris commented 6 years ago

We're using a hidden form input preceding the check input so that a value gets sent both when the checkbox is checked and when it isn't. AFAIK this is a universally supported technique. It is necessary because the profile backend only makes changes to posted fields, so absent values don't get interpreted as a request to change them to off.

I can't reproduce in my own test on chrome for Android. If someone who can reproduce this could get into network inspector and see what's being posted that would be really helpful

themightychris commented 6 years ago

Ahh I found the issue, I never marked the field as user-editable so it worked for me due to my staff access.

I fixed that and turned the newsletter off for everyone who has hit save on their profile since the newsletter went out -- 17 people. Many of them hit save multiple times, indicating it likely they were trying to update the newsletter field. It's possible some of these people just updated other aspects of their profile and didn't uncheck newsletter, but opting people out where we're in doubt seems like the best move.