Skip to content

fix: 안읽음 카운트 Redis INCR 연산 직렬화 에러 해결 - #482

Merged
sammool merged 2 commits into
developfrom
refactor/redis-channel
Jun 29, 2026
Merged

sammool merged 2 commits into
developfrom
refactor/redis-channel

Conversation

@sammool

@sammool sammool commented Jun 29, 2026

Copy link
Copy Markdown
Member

PR 제목

  • fix: 안읽음 카운트 Redis INCR 연산 직렬화 에러 해결

[원인]

  • RedisTemplate<String, Object>가 값을 JSON(GenericJackson2JsonRedisSerializer)으로 직렬화하여 저장("0")함.
  • 이후 메시지 수신 시 Redis의 INCR 명령어가 JSON 문자열에 적용되면서 ERR value is not an integer or out of range 에러 발생.

[해결]

  • 카운터 관리를 위해 값을 순수 문자열(Raw String)로 취급하는 StringRedisTemplate으로 교체.
  • 기존 캐시와의 충돌(NumberFormatException 등)을 방지하기 위해 Redis Key 네이밍을 chat:unread에서 chat:room_unread로 변경하여 새롭게 적재되도록 처리.

테스트 코드 작성 완료

관련 이슈

기타 공유 사항

  • 테스트 시 유의사항이나 논의할 포인트 등

@sammool sammool self-assigned this Jun 29, 2026
@sammool
sammool merged commit 969a1e3 into develop Jun 29, 2026
1 check passed
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.

1 participant