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

Ignore: 🐛 Modify Device Token Management Policy #209

Merged
merged 20 commits into from
Dec 4, 2024

Conversation

psychology50
Copy link
Member

작업 이유

This work resolves a push notification error caused by duplicate device tokens.

Currently, the {deviceId, token} pair's uniqueness isn't enforced, leading to the following issue:

  1. User 1 sign in on Device A.
  2. User 2 sign in on Device B.
  3. When User 2 sends a chat message in chatroom where User 1 is joined,
    they receive push notifications intended for User 1 via their token.

작업 사항

1️⃣ Improved Registration Logic

  • Return a 409 Conflict error if an activated token with a different deviceId exists.
  • Update deviceId when transferring token ownership.

2️⃣ Clarification Device Token Register Business Policy

  • Each {userId, deviceId} pair can register new tokens but activate only one.
  • token must be unique in table
  • Tokens and {deviceId, token} pairs must be unique.
  • Existing tokens update ownership and last login.
  • New tokens are added if not already registered.
  • Return 409 if a token exists for another deviceId.

리뷰어가 중점적으로 확인해야 하는 부분

  1. Appropriateness of Business Rule Implementation
  • Does DeviceTokenRegisterService align with the requirements?
  • Is exception handling, especially for duplicate tokens, valid?
  1. Domain Role Separation
  • Are entity and domain service roles appropriately divided?
  • Do unit and integration tests validate the core domain logic?
  1. Token Ownership Transfer
  • Is exception handling for mismatched deviceId valid?
  • Are ownership update scenarios correctly handled?

발견한 이슈

  1. Domain-Service vs. RDB Responsibility
  • DB constraints should be verified in the domain-rdb module.
  • Current tests extend beyond the domain service's responsibility.

@psychology50 psychology50 added bug 긴급하고, 중요도가 높은 이슈 fix 기능 수정 labels Dec 4, 2024
@psychology50 psychology50 self-assigned this Dec 4, 2024
@psychology50 psychology50 merged commit da609be into dev Dec 4, 2024
1 check passed
@psychology50 psychology50 deleted the fix/PW-643-fix-device-save branch December 4, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 긴급하고, 중요도가 높은 이슈 fix 기능 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant