[#347] Firebase 스케줄러가 동작하지 않아 Todo가 제거되지 않는 현상을 해결한다#348
Merged
Conversation
Comment on lines
+212
to
+221
| while (true) { | ||
| const collectionPath = collectionName === "notificationDispatches" ? | ||
| FirestorePath.notificationDispatches(userId) : | ||
| FirestorePath.notifications(userId); | ||
| const snapshot = await admin.firestore() | ||
| .collection(collectionPath) | ||
| .where("todoId", "==", todoId) | ||
| .limit(DELETE_BATCH_SIZE) | ||
| .get(); | ||
|
|
Contributor
Comment on lines
+116
to
+122
| export const cleanupUnusedTodoNotificationRecords = onSchedule({ | ||
| maxInstances: 1, | ||
| region: LOCATION, | ||
| schedule: "0 * * * *", | ||
| timeZone: "UTC" | ||
| }, | ||
| async () => { |
Contributor
Owner
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
이 PR은 normalizeError 함수를 toError로 리팩토링하여 Firebase 함수 전반의 오류 로깅을 간소화합니다. 또한, notification/cleanup.ts에 새로운 정리 함수들을 추가하여 todo 삭제 시 관련 알림 및 발송 기록을 자동으로 제거하고, 완료되었거나 마감일이 없는 todo의 발송 기록을 정리합니다. 기존의 soft-delete 정리 함수들도 문서 ID 기반 페이지네이션을 사용하도록 개선되었습니다. 코드 리뷰에서는 notifications, todoLists, webPages 컬렉션 그룹에 대한 특정 쿼리(예: isDeleted 필터링 및 documentId 정렬)에 필요한 복합 인덱스가 firestore.index.json에 누락되어 런타임 오류가 발생할 수 있음을 지적했습니다.
Comment on lines
90
to
+91
| .where("isDeleted", "==", true) | ||
| .orderBy(admin.firestore.FieldPath.documentId()) |
Contributor
There was a problem hiding this comment.
Comment on lines
+166
to
+167
| .where("dueDate", "==", null) | ||
| .orderBy(admin.firestore.FieldPath.documentId()) |
Contributor
Comment on lines
24
to
25
| .where("isDeleted", "==", true) | ||
| .orderBy(admin.firestore.FieldPath.documentId()) |
Contributor
Comment on lines
23
to
+24
| .where("isDeleted", "==", true) | ||
| .orderBy(admin.firestore.FieldPath.documentId()) |
Contributor
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.
Uh oh!
There was an error while loading. Please reload this page.