httptoolkit / httptoolkit-ui

The UI of HTTP Toolkit
https://httptoolkit.com
GNU Affero General Public License v3.0
288 stars 107 forks source link

Fix bugs in setting page #28

Closed shirshak55 closed 3 years ago

shirshak55 commented 3 years ago

Without this fix settings page gives:

Screenshot from 2021-07-24 12-31-29

After this: Screenshot from 2021-07-24 12-32-49

Cause:

If we make isPaidUser to true in accountStore to true (Although it's not recommend and I do have gifted pro subs by author of this repo).

If you see in console we get error it is due to fact the code in settings-page.tsx assumes subs is not undefined.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

pimterry commented 3 years ago

Thanks for the contribution! To be honest though, sorry, but I'd rather keep the existing behaviour, instead of stubbing in dev-only data here, so I'm going to close this.

Adding extra edge case logic like this adds extra complexity and things to maintain, risks creating subtle bugs, and it means that developers are testing this stub code, not the real user account code (so it's more likely we'll add bugs without realising).

It shouldn't be necessary anyway: everybody who's contributing to the codebase or anybody who really can't afford the product and needs a free account is welcome to have a free account anyway. The message in isPaidUser is supposed to encourage that, so nobody needs to hack around and set that to true!

For development, it's much better if we all use normal accounts with the normal login flow, not a special developer process. It's good to keep development usage as close to deployed usage as possible for accurate testing :smile:. If there's anything that makes that difficult though then of course let me know, I'm definitely interested in smoothing out any issues there.