Skip to content

[DABOM-409] 가족 데이터량이 0MB가 되었을 때 차단되는 현상 수정#51

Merged
ChoiSeungeon merged 1 commit intodevelopfrom
feat/DABOM-409
Mar 12, 2026
Merged

[DABOM-409] 가족 데이터량이 0MB가 되었을 때 차단되는 현상 수정#51
ChoiSeungeon merged 1 commit intodevelopfrom
feat/DABOM-409

Conversation

@ChoiSeungeon
Copy link
Contributor

🍀 이슈 & 티켓 넘버


🎯 목적

가족 공유 데이터와 동일한 기준으로, 개인 월 사용량도 한도에 정확히 도달하는 마지막 사용 이벤트는 허용하고 그 다음 이벤트부터 차단되도록 정책을 맞추기 위함

📝 변경 사항

  • usage_update.lua의 사용량 판정 로직 정리
  • 가족 잔여량이 정확히 0이 되는 마지막 이벤트를 차단 상태가 아닌 허용 사용으로 처리하도록 수정
  • 중복 방지 로직과 사용량 판정 로직의 주석/흐름 정리
  • 관련 usage 테스트 재검증

📂 변경 범위

도메인 controller service repository entity infra global
usage [x] [x]

🖥️ 주요 코드 설명

if currentRemaining < usageBytes then
    return getResult('FAMILY_QUOTA_EXCEEDED', currentMonthly, false)
end

local newRemaining = redis.call('DECRBY', KEYS[2], usageBytes)
local newMonthly = redis.call('INCRBY', KEYS[3], usageBytes)

local status = 'NORMAL'
local ratio = 0

if totalLimit > 0 then
    ratio = newRemaining / totalLimit
end

💬 리뷰어에게


📋 체크리스트

기본

  • Merge 대상 브랜치가 올바른가?
  • ./gradlew build가 정상적으로 통과하는가?
  • Spotless / Checkstyle을 통과하는가? (./gradlew spotlessApply checkstyleMain)
  • 전체 변경사항이 500줄을 넘지 않는가?

코드 품질

  • 의존성 방향을 준수하는가? (Controller → Service → Repository → Entity)
  • Setter 없이 비즈니스 메서드로 상태를 변경하는가?
  • @Transactional은 Service에만 선언했는가?

테스트

  • 신규 비즈니스 로직에 대한 단위 테스트를 작성했는가?

📌 참고 사항

@github-actions github-actions bot added the size/M PR size: M label Mar 12, 2026
@github-actions github-actions bot requested a review from swthewhite March 12, 2026 08:21
@github-actions github-actions bot added the fix 버그 수정 label Mar 12, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 가족 공유 데이터 사용량 정책을 개인 월 사용량 정책과 동일하게 맞추기 위해 구현되었습니다. 이제 가족 데이터 잔여량이 정확히 한도에 도달하는 마지막 사용 이벤트는 허용되며, 그 이후의 사용 이벤트부터 차단됩니다. 이는 사용자 경험을 개선하고 데이터 사용량 계산의 일관성을 확보하는 데 중점을 둡니다.

Highlights

  • 가족 데이터 사용량 정책 개선: 가족 데이터량이 0MB가 되었을 때 차단되는 현상을 수정하여, 잔여량이 정확히 0이 되는 마지막 사용 이벤트는 허용하고 그 다음 이벤트부터 차단되도록 정책을 변경했습니다.
  • 사용량 판정 로직 정리: usage_update.lua 파일 내의 사용량 판정 로직을 정리하고 가독성을 개선했습니다.
  • 코드 주석 및 흐름 개선: 중복 방지 로직과 사용량 판정 로직의 주석 및 전체적인 코드 흐름을 명확하게 정리했습니다.
  • 테스트 재검증: 관련된 사용량(usage) 테스트를 재검증하여 변경 사항의 정확성을 확인했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/resources/lua/usage_update.lua
    • userRatio 계산 로직의 가독성을 개선했습니다.
    • 중복 방지, 고객 정책 제약 로딩, 사용량 반영, 후속 상태 계산 섹션의 주석을 명확하게 정리했습니다.
    • 스크립트 전반에 걸쳐 문자열 리터럴을 일관되게 작은따옴표로 변경했습니다.
    • 가족 데이터 잔여량이 정확히 0이 되는 마지막 사용 이벤트를 허용하도록 FAMILY_QUOTA_EXCEEDED 판정 로직을 수정했습니다.
    • 경고 상태 계산 로직을 간소화하고 status 변수 초기화 및 조건부 할당 방식을 개선했습니다.
Activity
  • 이슈 #50이 닫혔습니다.
  • Jira 티켓 DABOM-209와 연관되어 있습니다.
  • 제출 전 체크리스트의 모든 항목이 완료되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

SonarQube Quality Summary (Community)

Quality Gate PASSED

Branch: feat/DABOM-409
Compared to: default branch

Issues

  • 🐞 Bugs: 7
  • 🔐 Vulnerabilities: 0
  • 📎 Code Smells: 93

Measures

  • Coverage: 0%
  • Duplication: 0%

🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=dabom-processor-usage&branch=feat/DABOM-409

Generated automatically by GitHub Actions.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 잔여 데이터가 정확히 0이 될 때 사용이 차단되던 문제를 수정합니다. usage_update.lua 스크립트의 로직을 수정하여 의도한 대로 동작하게 한 점이 좋습니다. 코드 가독성과 일관성을 높이기 위한 리팩토링도 잘 적용되었습니다. 다만, 스타일 가이드에 따라 유지보수성을 더 향상할 수 있는 부분을 한 가지 제안합니다.

Copy link
Contributor

@swthewhite swthewhite left a comment

Choose a reason for hiding this comment

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

0MB인 남은 경우는 아직 허용 단계라는 것을 잘 구현한 것 같습니다.

@ChoiSeungeon ChoiSeungeon merged commit aca1f32 into develop Mar 12, 2026
12 checks passed
@swthewhite swthewhite deleted the feat/DABOM-409 branch March 12, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 버그 수정 size/M PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DABOM-409] 마지막 10MB 문제 명확화

2 participants