fix: 적립 이행 점검이 기록된 입금을 못 읽던 문제 - #458
Merged
Merged
Conversation
kr_pocket 첫 적립금을 기록한 뒤에도 헬스가 '입금 기록 0건'이라고 계속 보고했다. get_cash_flows는 (occurred_at, amount) 튜플 목록을 주는데 점검 쪽이 객체로 읽어 (getattr(f, "occurred_at")) 항상 None을 잡았다. 증상이 고약하다. 크래시도 예외도 없이 '입금이 없다'는 틀린 사실을 단정적으로 말한다. 입금을 실제로 한 사람은 헬스를 믿지 않게 되고, 안 한 사람은 같은 문구를 보고도 진짜인지 알 수 없다 — 경보가 정보를 잃는다. 반환 형태를 테스트로 고정했다. 튜플 언패킹이 맞는지, 그리고 기록한 입금이 실제로 점검에 잡히는지 두 가지를 건다. 객체 접근이 None을 준다는 것까지 명시해 뒀다. 계약이 바뀌면 호출부가 조용히 None을 얻는 자리이기 때문이다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
kr_pocket 첫 적립금을 기록한 뒤에도 헬스가 계속 이렇게 보고했다.
cash_flows에는 분명히 행이 있었다.원인
get_cash_flows는(occurred_at, amount)튜플 목록을 반환하는데, 적립 이행 점검이 객체로 읽었다.튜플에는 그 속성이 없으니 항상
None이 잡히고, 점검은 그걸 '입금 이력 없음'으로 해석했다.왜 이게 나쁜가
크래시도 예외도 없이 틀린 사실을 단정적으로 말한다. 입금을 실제로 한 사람은 헬스를 안 믿게 되고, 안 한 사람은 같은 문구를 보고도 진짜인지 알 수 없다. 경보가 정보를 잃는다.
이번 세션에 넣은 점검이라 운영에 노출된 시간은 짧았지만, 형태가
docs/OPERATING_PRINCIPLES.md에 적어 둔 이 저장소의 대표 실패 패턴과 똑같다 — 오류 0건인데 사실이 틀림.조치
튜플 언패킹으로 고치고, 반환 형태를 테스트로 고정했다.
get_cash_flows가(datetime, float)튜플을 준다는 계약None을 준다는 것까지 명시 — 계약이 바뀌면 호출부가 조용히None을 얻는 자리다검증