Skip to content

Conversation

@junggyo1020
Copy link
Contributor

@junggyo1020 junggyo1020 commented May 2, 2025

⚙️ ISSUE

📄 Work Description

  • 스크랩 유저를 동기화 시, userId를 기준으로 스크랩 테이블을 추가하게 되어, 빈 리스트가 반환되고 있었습니다.
  • 따라서 oUserId를 기준으로 스크랩 동기화가 이루어질 수 있도록 로직을 수정했습니다!
  • 중간에 생성되는 스크랩 동기화 유저 수와 알림이 전송되는 수를 빠르게 파악하기 위해, writer 부분에 log를 추가했습니다! 이부분은 이후에 QA가 완료된 이후 삭제할 예정입니다.

✅ 테스트

현재 테스트 서버의 유저는 3명

image

3명의 유저 중 1명의 유저만 스크랩을 한 상황(운영서버 userId = 115)

image

스크랩 동기화 실행 (알림서버에 oUserId(운영서버 userId) = 115, userId = 15인 유저의 스크랩 정보 동기화 완료)

1. 실행 전

image

2. 실행 후

image image

스크랩한 유저에게만 푸시알림 발송 성공 (스크랩한 유저 1명에게만 푸시알림 발송)

image image image image image

✅ PR check list

  • Reviewers
  • Assignees
  • Labels

@junggyo1020 junggyo1020 added the ♻️ refactor 코드 리팩토링 ex) 형식변경 label May 2, 2025
@junggyo1020 junggyo1020 self-assigned this May 2, 2025
@junggyo1020 junggyo1020 merged commit 61b261f into develop May 2, 2025
1 check passed
Copy link
Member

@JungYoonShin JungYoonShin left a comment

Choose a reason for hiding this comment

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

오홍 이런 문제가 있었군요!! 해결하느라 고생많으셨습니다~~

한가지 궁금한게 있는데 알림서버와 운영서버간에 스크랩 유저를 동기화할 때, 운영서버에서 스크랩을 취소하여 스크랩한 공고가 없는 유저의 경우는 알림서버 Scarp 테이블에서 지워주거나 ScrapStatus`의 상태값을 update 해주는 작업도 되어있나요?!

public void sync(List<Long> userIds) {
List<Long> distinctUserIds = userIds.stream().distinct().toList();
public void sync(List<Long> oUserIds) {
List<Long> distinctOUserIds = oUserIds.stream().distinct().toList();
Copy link
Member

Choose a reason for hiding this comment

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

운영서버로 받아오는 스크랩한 userId가 중복되기도 하여서 oUserIds.stream().distinct().toList() 요거로 중복제거하는 건가요??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 코드 리팩토링 ex) 형식변경 size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[♻️ refactor] 스크랩 유저를 동기화 시, oUserId를 기준으로 scrap 테이블에 추가되도록 수정

3 participants