Repository navigation
fix: 공유 코드를 만들 때 코드 없이 저장된 일정도 함께 맞춘다 (178) - #181
Merged
Merged
Conversation
일정은 저장할 때의 공유 코드를 문서에 굳혀 넣는다. 신호가 약한 곳에서 처음 로그인하면 코드가 비어 있고, 그 사이에 만든 일정은 sharedCode 가 빈 채로 남는다. 보안 규칙의 공유 읽기가 sharedCode != "" 를 요구하므로 그 일정들은 가족이 어떤 코드로도 읽지 못한다. 사용자 쪽에서는 코드를 만들어 가족에게 알려 줬는데 일정이 안 보인다. 화면 어디에도 이유가 없고 되돌릴 길도 없다 — 「공유 코드 다시 만들기」(#134)는 사용자 문서만 고쳐서, 고쳤다는 잘못된 안심만 주고 있었다. 코드를 보장하는 자리(로그인 직후와 다시 시도 버튼) 뒤에서 코드가 빈 내 일정에 코드를 채운다. 실패해도 코드 만들기 결과를 뒤집지 않는다 — 다음 로그인에서 다시 맞춘다.
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.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
무엇이 문제였나
일정은 저장할 때의 공유 코드를 문서에 굳혀 넣는다(
ScheduleRepository.addSchedule). 신호가 약한 곳에서 처음 로그인하면 코드가 비어 있고, 그 사이에 만든 일정은sharedCode가 빈 문자열로 저장된다.보안 규칙의 공유 읽기는
sharedCode != ""를 요구한다. 그래서 나중에 코드를 만들어도 그 일정들은 가족이 어떤 코드로도 읽지 못한다.사용자 쪽에서 보이는 것은 이렇다. 코드를 만들었고, 가족에게 알려 줬고, 가족 앱에는 아무것도 안 뜬다. 화면 어디에도 이유가 없다. 「공유 코드 다시 만들기」(#134)는 사용자 문서만 고쳐서, 눌러도 아무것도 달라지지 않는데 「고쳤다」 는 안심만 준다.
어떻게 고쳤나
코드를 보장하는 자리 뒤에서 코드가 빈 내 일정에 코드를 채운다. 두 자리 모두 지난다 — 로그인 직후(
AuthManager)와 내 정보 화면의 다시 시도 버튼(ProfileViewModel).userId+sharedCode == ""). 이미 코드가 있는 일정은 건드리지 않는다updatedAt만 흔들린다확인
단위 테스트 통과. lint · ktlint 통과.