You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
사용자의 문의내역을 불러오는 쿼리는 원래,
where(documentId(), "in", inquiryIds)로, 유저 문서의 inquiryIds에 포함된 문의 내역을 불러오는 것으로 작성하였다.
그러나 인피니트 스크롤을 도입하면서 문제가 발생하였는데, where(documentId(), "in", inquiryIds)의 조건으로 데이터를 받으면
파이어베이스가 문서의 id로 정렬하여 데이터를 반환하기 때문에, 원래 의도한 순서와 다르게 정렬된 데이터를 받게된다.
예를 들어,
첫 20개의 문의내역을 받고 다음 20개의 문의내역을 받을 때, 나중에 받은 문의내역에 포함된 문의가 처음 받은 문의 들보다 먼저 작성된 것이 있을 수 있다는 것이다. 즉, 화면에서 스크롤을 내리며 보는 문의 내역의 순서가 엉켜있는 것이다.
파이어베이스 내부 정렬을 방지할 수 있는 방법이 없었기 때문에, where("userId", "==", userId)로 쿼리를 수정하였다.
Beta Was this translation helpful? Give feedback.
All reactions