Skip to content

[#338] HomeView의 최근 수정 섹션 내용이 반영되지 않는 문제를 해결한다#339

Merged
opficdev merged 4 commits intodevelopfrom
fix/#338-Recent-Modify
Mar 30, 2026
Merged

[#338] HomeView의 최근 수정 섹션 내용이 반영되지 않는 문제를 해결한다#339
opficdev merged 4 commits intodevelopfrom
fix/#338-Recent-Modify

Conversation

@opficdev
Copy link
Copy Markdown
Owner

@opficdev opficdev self-assigned this Mar 30, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes custom Equatable implementations across several structs to rely on compiler-synthesized member-wise equality. A critical issue was identified where the existing custom hash(into:) methods were not updated to match the new equality logic, violating the Hashable protocol contract which requires equal objects to have identical hash values. The reviewer provided actionable feedback to update the hashing logic for PushNotificationItem, RecentTodoItem, TodayTodoItem, and WebPageItem to ensure consistency and prevent bugs in collections or SwiftUI view updates.

Comment on lines 29 to 31
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

== 연산자 구현을 제거하여 컴파일러가 멤버와이즈(member-wise) ==를 합성하도록 변경하셨습니다. 이는 모든 프로퍼티를 비교하게 되는데, 현재 hash(into:) 구현은 id 만을 사용하고 있어 Hashable 프로토콜의 규칙(a == b 이면 a.hashValue == b.hashValue)을 위반합니다. 이로 인해 Set이나 Dictionary에서, 또는 SwiftUI 뷰 업데이트 시 예기치 않은 동작이 발생할 수 있습니다.

hash(into:)가 합성된 ==와 일관성을 갖도록 모든 프로퍼티를 해싱하도록 수정해야 합니다.

    func hash(into hasher: inout Hasher) {
        hasher.combine(id)
        hasher.combine(title)
        hasher.combine(body)
        hasher.combine(receivedAt)
        hasher.combine(isRead)
        hasher.combine(todoId)
        hasher.combine(todoCategory)
    }

Comment on lines 29 to 31
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

== 연산자 구현을 제거하여 컴파일러가 멤버와이즈(member-wise) ==를 합성하도록 변경하셨습니다. 이는 모든 프로퍼티를 비교하게 되는데, 현재 hash(into:) 구현은 id 만을 사용하고 있어 Hashable 프로토콜의 규칙(a == b 이면 a.hashValue == b.hashValue)을 위반합니다. 이로 인해 Set이나 Dictionary에서, 또는 SwiftUI 뷰 업데이트 시 예기치 않은 동작이 발생할 수 있습니다.

hash(into:)가 합성된 ==와 일관성을 갖도록 모든 프로퍼티를 해싱하도록 수정해야 합니다.

    func hash(into hasher: inout Hasher) {
        hasher.combine(id)
        hasher.combine(number)
        hasher.combine(title)
        hasher.combine(isPinned)
        hasher.combine(updatedAt)
        hasher.combine(tags)
        hasher.combine(category)
    }

Comment on lines 31 to 33
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

== 연산자 구현을 제거하여 컴파일러가 멤버와이즈(member-wise) ==를 합성하도록 변경하셨습니다. 이는 모든 프로퍼티를 비교하게 되는데, 현재 hash(into:) 구현은 id 만을 사용하고 있어 Hashable 프로토콜의 규칙(a == b 이면 a.hashValue == b.hashValue)을 위반합니다. 이로 인해 Set이나 Dictionary에서, 또는 SwiftUI 뷰 업데이트 시 예기치 않은 동작이 발생할 수 있습니다.

hash(into:)가 합성된 ==와 일관성을 갖도록 모든 프로퍼티를 해싱하도록 수정해야 합니다.

    func hash(into hasher: inout Hasher) {
        hasher.combine(id)
        hasher.combine(number)
        hasher.combine(title)
        hasher.combine(tags)
        hasher.combine(isPinned)
        hasher.combine(updatedAt)
        hasher.combine(dueDate)
        hasher.combine(category)
    }

Comment on lines 23 to 25
func hash(into hasher: inout Hasher) {
hasher.combine(metadata.url)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

== 연산자 구현을 제거하여 컴파일러가 멤버와이즈(member-wise) ==를 합성하도록 변경하셨습니다. 이는 metadata 프로퍼티 전체를 비교하게 되는데, 현재 hash(into:) 구현은 metadata.url 만을 사용하고 있어 Hashable 프로토콜의 규칙(a == b 이면 a.hashValue == b.hashValue)을 위반합니다. 이로 인해 Set이나 Dictionary에서, 또는 SwiftUI 뷰 업데이트 시 예기치 않은 동작이 발생할 수 있습니다.

hash(into:)가 합성된 ==와 일관성을 갖도록 metadata의 모든 프로퍼티를 해싱하도록 수정해야 합니다. 가장 좋은 방법은 WebPage 타입을 Hashable로 만드는 것이지만, 그것이 불가능하다면 아래와 같이 직접 프로퍼티를 해싱해야 합니다.

    func hash(into hasher: inout Hasher) {
        hasher.combine(metadata.title)
        hasher.combine(metadata.url)
        hasher.combine(metadata.displayURL)
        hasher.combine(metadata.imageURL)
    }

@opficdev opficdev added the qa TestFlight에 배포 label Mar 30, 2026
@opficdev opficdev merged commit deda164 into develop Mar 30, 2026
1 check passed
@opficdev opficdev deleted the fix/#338-Recent-Modify branch March 30, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa TestFlight에 배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HomeView의 최근 수정 섹션 내용이 반영되지 않는 문제를 해결한다

1 participant