Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add bad word filter to guild name creation for respectful naming #262

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eun2ce
Copy link

@eun2ce eun2ce commented Jan 23, 2025

안녕하세요. gitanimals기능을 잘 사용하고있는 초보 개발자 중 한명입니다.

길드명에 대한 제약이 없어 약용될까 간단한 처리방식 제안 드리립니다.
추가로 기여할 수 있는 방법에 대한 문서나 방법등에 대한 내용도 기재되면 좋겠습니다.

흥미로운 프로젝트를 접할 수 있는 기회 주셔서 감사합니다.

ps)어디에 PR을 드리면 좋을지 모르겠어서 일단 main 브랜치로 드립니다. 피드백주시면 반영해보겠습니다 감사합니다.

@eun2ce eun2ce requested a review from devxb as a code owner January 23, 2025 09:23
Copy link
Member

@devxb devxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요. 🙇‍♂️
라이브 서비스 백엔드 코드에 기여하는것이 쉽지 않을건데, 관심갖고 기여해주셔서 감사드립니다.
길드 네이밍에 대한 생각하지 못한 부분 아이디어를 제공해주셔서 감사드리며, 말씀해주신 기여하는 방법등은 적용해서 올려두도록 하겠습니다. 👍

api, client repository 마다 기여 정책은 조금 다를 수 있겠지만 Gitanimals 레포지토리는 기여를 환영합니다.

다시 한번 감사드립니다.

@@ -28,6 +28,12 @@ class GuildService(
autoJoin: Boolean,
createLeaderRequest: CreateLeaderRequest,
): Guild {
val forbiddenWords = listOf("fuck")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하면, createGuild를 할때마다 새로운 list가 생성되어 서버 메모리에 부담이 될 것 같습니다.
전역적으로 하나의 forbiddenWords를 생성할수도 있을것 같지만, 관리하는 측면에서의 고려도 필요할 것 같아요.

아래의 사항에 대해서도 고려해주시면 감사하겠습니다.

  1. 예상치 못한 forbiddenWords 가 들어오는것에 대한 판단을 자동화 할 수 있을까요?
    힘들다면, forbiddenWords에 포함되는 단어 추가를 적은 리소스를 소모해 판단할 수 있는 방법은 무엇이 있을까요?
  2. 필터링 하지 못해서 이미 만들어진 부적절한 이름의 길드에 대해서는 삭제를 진행해야할 것 같습니다.
    이때 길드를 생성할때 사용된 포인트를 롤백하는 로직도 필요할 것 같아요.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가로, Gitanimals는 Fat domain모델을 지향하고 있습니다.
길드를 생성할 수 없는 조건은 Domain 에 포함되어야할 것 같아요.

Copy link
Author

@eun2ce eun2ce Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

첫 번째 고려사항 같은경우에는 여러가지 방법이 있을 수 있겠지만 자동화를 생각하면 괜찮은 api들을 활용하는 것이 있겠습니다.(예를들자면 google perspective api,bad word api )

2번 사항같은 경우는
길드를 삭제하는 기능이 먼저 추가되어야 할 것 같습니다. ( 그 외에는 관리자가 수동으로 길드 생성 로그를 확인해 돌려주는 법이 현재로선 가능할 것 같습니다.)

한 가지 제안을 드리자면 사용자 신고기능을 추가하는 것이 좋을 것 같습니다.
여러모로 리소스가 덜 들수 있는 방법 같습니다.

@devxb devxb added the enhancement New feature or request label Jan 23, 2025
Comment on lines +369 to +371
val forbiddenWordsList = lazy {
listOf("fuck", "shit", "hate", "bitch")
}.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forbiddenWordsList가 core의 Svgs안에서 관리되는것 같은데요.
gitanimals에서는 Svgs안에 Svg관련 데이터만 넣고 있습니다.

추가로, forbiddenWordsList는 Guild생성시에만 사용되는데이터로 Guild안에 있어야할거 같아요.


별개로, 불가능한 단어를 정적으로 관리하는 방식은 지속가능한 방식이 아닙니다.
새로운 불가능한 단어가 추가될때마다, 개발자가 forbiddenWordsList에 내용을 추가하고 서버를 재배포 해야하니까요.

따라서, 말씀해주신것 처럼 api를 이용한 방식을 차용해야 할거 같습니다.


다만, 이 방식은 api 토큰등 내부 작업이 필요해보여서 outside collaborator가 하기에는 조금 무리가 있을거라고 생각합니다.
제가 시간이 날때 요 PR에 현재 작업해주신 내용과 관련 내용을 함께 작업해서 collaborator로 넣어드리는 방향을 생각하고 있는데 어떻게 생각하시나요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그래주시면 감사하겠습니다.
제 의견을 긍정적으로 받아들여 주셔서 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants