Skip to content
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

Fix order of loading consent #181

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/XMTP/Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ConsentList {
preferences.append(try PrivatePreferencesAction(serializedData: Data(payload)))
}

preferences.forEach { preference in
preferences.reversed().forEach { preference in
preference.allow.walletAddresses.forEach { address in
consentList.allow(address: address)
}
Expand Down
7 changes: 7 additions & 0 deletions Tests/XMTPTests/ConversationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,13 @@ class ConversationTests: XCTestCase {

// Conversations you start should start as allowed
XCTAssertTrue(isAllowed)

try await bobClient.contacts.block(addresses: [alice.address])
try await bobClient.contacts.refreshConsentList()

let isBlocked = (await bobConversation.consentState()) == .blocked

XCTAssertTrue(isBlocked)

let aliceConversation = (try await aliceClient.conversations.list())[0]
let isUnknown = (await aliceConversation.consentState()) == .unknown
Expand Down
2 changes: 1 addition & 1 deletion XMTP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
#

spec.name = "XMTP"
spec.version = "0.6.3-alpha0"
spec.version = "0.6.4-alpha0"
spec.summary = "XMTP SDK Cocoapod"

# This description is used to generate tags and improve search results.
Expand Down