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

Web push notification w/ FCM topic #368

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft

Conversation

TriangleYJ
Copy link
Member

@TriangleYJ TriangleYJ commented Jan 25, 2023

관련 티켓

Feature

  • 게시판 구독 버튼 추가: 게시글에 새로운 글이 달릴 때 알림
  • 게시글 구독 버튼 추가: 새로운 댓글 혹은 대댓글이 달리면 당사자가 아닌 제 3자한테도 받을 수 있도록 하는 버튼 추가 (에타의 게시글 댓글 알림 버튼과 동일)

TODO 라고 되어 있는 부분 의견 있으시면 알려주세요!

apps/user/models/fcm_topic.py Outdated Show resolved Hide resolved
apps/core/migrations/0044_alter_notification_type.py Outdated Show resolved Hide resolved
apps/core/models/signals/article.py Show resolved Hide resolved
apps/user/views/fcm.py Outdated Show resolved Hide resolved
elif mode == "update":
if not request.user.is_authenticated:
return Response(status=status.HTTP_401_UNAUTHORIZED)
token = FCMToken(token=token, user=request.user, last_activated_at=Now())
Copy link
Member

Choose a reason for hiding this comment

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

기존 다른 코드들에서는 django.utils.timezone.now()를 사용했었는데 django.db.models.functions.Now()도 있었군요. 쿼리가 실행되었을 당시의 서버의 날짜와 시각을 반환한다고 하는데 timezone 문제가 발생하지는 않을지 여쭙습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

오.. 그 부분은 생각을 못했었어요 last_activated_at 이 그렇게 중요한 컬럼은 아니라서 django.utils.timezone.now() 로 바꾸어도 될 것 같아요

Copy link
Member

Choose a reason for hiding this comment

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

Stack Overflow에서 두 차이를 설명하고 있는데 일단은 혹시 모르니 django.utils.timezone.now()를 사용합시다.

apps/user/views/fcm.py Outdated Show resolved Hide resolved
apps/user/views/fcm.py Outdated Show resolved Hide resolved
ara/firebase.py Outdated Show resolved Hide resolved
ara/firebase.py Outdated Show resolved Hide resolved
ara/firebase.py Outdated Show resolved Hide resolved
@TriangleYJ
Copy link
Member Author

리뷰 반영했습니다. 우선 아래 이유로 지금 당장 머지할수는 없어서 해결이 된다면 머지를 하겠습니다.

  • 프론트엔드 머지 필요 - Feature/fcm topic example new-ara-web#370 (기존의 fcm token 요청 url 형식 바뀜)
  • 테스트코드 추가 (firebase 테스트코드는 둘째 치더라도, 새로운 Notification 알림 패턴에 맞추어 테스트코드 필요)
  • 기타 여러 TODO 사항들

@retroinspect retroinspect changed the title Feature/fcm topic Web push notification w/ FCM topic Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants