release: 대상당 활성 공유 링크는 1개 - #170
Merged
Merged
Conversation
대상 구성은 조인 테이블 둘에 흩어져 있어 유니크 제약을 직접 걸 수 없다. 정렬된 식별자 목록의 해시를 비정규화해 shares 한 테이블에서 비교한다.
발급할 때마다 링크가 쌓여 살아있는 공개 URL 수에 상한이 없었다. 토큰 원문을 저장하지 않아 기존 링크의 URL 을 다시 내려줄 수 없으므로 재사용이 아니라 교체다.
…-target/#168 refactor: 대상당 활성 공유 링크는 1개
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.
관련 이슈
변경 내용
shares.target_hash추가 +UNIQUE (user_id, target_hash) WHERE status = 'ACTIVE'(V31)작업 목적
공유 버튼을 누를 때마다 새 링크가 생기고 이전 링크가 계속 살아 있어, 살아있는 공개 URL 수에
상한이 없었다. 공유를 다시 만드는 행위를 "이전 링크는 그만 쓰겠다" 로 정의해 링크 수를 대상
가짓수로 유계로 만든다.
테스트 방법
체크리스트
기타 사항
남는다. 폐기 대상은 전부 테스트 계정이 같은 대상으로 중복 생성한 링크이고, 외부 사용자
계정의 링크는 영향받지 않는 것을 배포 전 확인했다.