Closed ozair-dev closed 2 years ago
Someone is attempting to deploy a commit to a Personal Account owned by @Mayank0255 on Vercel.
@Mayank0255 first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Updated |
---|---|---|---|
stackoverflow-clone-frontend | โ Ready (Inspect) | Visit Preview | Jul 13, 2022 at 8:08AM (UTC) |
@ozair-dev
Not able to see the censorship working actually,
https://stackoverflow-clone-fronten-git-fbdb88-mayank2aggarwal-gmailcom.vercel.app/tags/penis https://stackoverflow-clone-fronten-git-fbdb88-mayank2aggarwal-gmailcom.vercel.app/questions/95e661a4-2364-4a1d-aa21-2fcf731d54d3 https://stackoverflow-clone-fronten-git-fbdb88-mayank2aggarwal-gmailcom.vercel.app/questions/957a9d9d-247d-4710-a55c-9bc2c99d388b https://stackoverflow-clone-fronten-git-fbdb88-mayank2aggarwal-gmailcom.vercel.app/questions/371f797c-b749-43ff-83c8-b6607e1bdc7b
The censorship is applied when a new post, comment or answer is submitted. Please try adding a new post and test for yourself if it works. And if you don't like it this way! then I'll apply censorship to the post, answer, comment preview instead of submission stage
@ozair-dev I think you can remove censorchip from submission, as I think we can store uncensored data, and display with censorship
@Mayank0255 sure, I will censor comments, answers, and the posts. But I think the tags should not be censored because what's the point of showing a tag named s**t? Instead, I won't allow swear words for tags while submission. By doing that, we wont get new abusive tags.
@Mayank0255
please review the PR,
I'hv censored the bad words in a way that only first and last letter is shown.
Also note that some abusive words won't be censored when joined with other words, for example ass in assume wont be censored, like wise pooppoopoop wont be censored. This is just how the package (which I used for censoring) works. But you'll see that it works very well in common scenerios.
Tags are not censored. Instead, they are detected at post submission and an error is shown
@ozair-dev cool, One suggestion, can change the tags censor text to, "Inappropriate words are not allowed"
As the current text seems like that only tags cannot be Inappropriate ๐ , though they can write inappropriate words for title and body but why tell them that
One suggestion, can change the tags censor text to, "Inappropriate words are not allowed"
Can do, but
As the current text seems like that only tags cannot be Inappropriate sweat_smile, though they can write inappropriate words for title and body but why tell them that
If the title or body contain inappropriate words, it won't terminate the dispatching of the formData, so user is actually allowed to write inappropriate words there, but If the tags contain the inappropriate words then dispatching is stopped, so I specifically mentioned tags cannot contains inappropriate words. But I'll still make the changes as you have asked for.
@Mayank0255 Just a quick heads-up before you merge the changes! While matching and replacing bad words, a bunch a regex operations happens behind the scenes on each post, comment and answer, and this makes the page loading very slow. And in my opinion, to avoid this, the data must be censored on each submission. So we don't have to use regex on page load. I don't know how big companies do these censorship on data, but as far as I know, we just can't (or shouldn't) do it after data retrieval.
By how much is the page loading time increasing?
On my machine, it's taking about 43 seconds. IMO, each post takes anywhere from 100-300ms, (speed may vary depending on processor speed), so it is wise to censor bad words on submission.
I'm busy these couple of days. Will try when I am free In sha'Allah.
I'm busy these couple of days. Will try when I am free In sha'Allah.
Sure, no problem
I have removed censoring for posts on data retrieval and instead, I am censoring title and body of each PostItem.compoent component on render. It stills takes about 43 seconds for HomePage to load. And additional 43 seconds (more or less depending on amount of text and machine's speed etc) on each pagination.
Here in the screenshot, you can see in console how much time each text is taking to be censored. Even the amount of time taken to censor even a small string is not negligible
Long story short, censoring text on rendering also does not reduce the loading time.
Deploy the changes and see the time time taken to censor each text in console to get a better idea.
@ozair-dev
questions page is breaking
fixed
@ozair-dev looks good enough, just remove the logs and I will merge
Done
@ozair-dev Merged๐๐
[x] Max length limit for Tag Name while creation: 25 Characters![](https://user-images.githubusercontent.com/65649182/177059328-ff7402db-e0cc-44c1-9ad5-932eb89923a9.png)
[x] All Tag Names Should Be In English, So Translate it or don't allow it![](https://user-images.githubusercontent.com/65649182/177059683-e2ee56ad-8af6-47cc-9f33-aea02aea083e.png)
[x] Users Per Page Should Be 15, not 16![](https://user-images.githubusercontent.com/65649182/177059405-38286cb2-d1c8-4455-89e4-b7975576dc2d.png)
[x] Validate the language users are inputting, dont allow any abuses or curses
I have added a function
censorBadWords
(which can take string, object or array of strings as arguments and convert the bad words to censored words) to the services directory and it is being used in the formSubmit before dispatching.Please review the PR and let me know if you want more changes.