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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat]: Bookmark to survey #376
[feat]: Bookmark to survey #376
Changes from 6 commits
3a586b3
3719ea2
74c4a16
c5c27f3
56a0ce8
11acaa0
d8d662c
e346589
2a4c179
b60f726
c753ae7
fe2718d
e08d6d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
플립보다는 북마크하기 취소하기 나눠서 만들고 멱등하게 동작시키는게 동시성 제어에 더 편할 것 같은데
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음.. 그런가?
나눠서 만들어도 동시요청 들어오면 갱신손실은 똑같이 발생할 수 있는거아냐? (survey 모듈쪽이 클린아키텍처라서 읽고 업데이트 해야함)
결국 두 방식 모두 락 획득해서 작업해야하는데, 북마크는 갱신손실 나도 문제없을거라 생각했고
클라 입장에서 현재 북마크상태 상관없이 flip 호출만하면 되니까 이게 편할거라 생각해서 이렇게 구현했어
별루??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫 따닥은 어차피 둘 다 막아야되고 나머지는 updatedAt 같은 거 받아서 낙관적락 같은 느낌이 멱등성 가져가도 될 거 같은디?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d8d662c
낙관적 락 추가함 이 로직이 동시성 문제나면 한쪽은 실패하는게 맞는거 같아서 낙관적락 예외 retry는 안했어
근데, 내가 잘 이해를 못하고있는거 같은데 이 로직에서 멱등성 가져가는게 API 사용성 가져가는거보다 장점인게 아직 와닿지 않는달까나
나는 여기서 멱등하지 않는게 사용성을 높여주는거 같아서 (누르면 반대상태로 전환됨) 흠흠...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 기능들은 클라이언트쪽에서 디바운스를 걸어주는게 좋음. 북마크했다가 바로 취소하거나 할 수 있기 때문에. 그러면 최종적 상태에 대한 요청을 보내도록 유도할 수 있음.
근데 지금 위와 같은 형태는 빠르게 사용자가 요청 했다가 취소 하면 요청 2번을 처리해야 함.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 이해했어 따닥 했을때 멱등성이 없으면, 클라이언트 요청을 맞춰주기위해서 요청처리를 2번해야하는구만
수정완
e08d6d8
나중에 취소 API도 하나 더 뚫겠음