Skip to content

fix/session-name-not-updated-after-change-on-another-device#1066

Merged
xameYeoh merged 6 commits intodevelopfrom
fix/session-name-not-updated-after-change-on-another-device
Jul 17, 2025
Merged

fix/session-name-not-updated-after-change-on-another-device#1066
xameYeoh merged 6 commits intodevelopfrom
fix/session-name-not-updated-after-change-on-another-device

Conversation

@xameYeoh
Copy link
Collaborator

Contains fix for the ticket

@xameYeoh xameYeoh requested a review from mpanuszewska July 16, 2025 13:41
Comment on lines +50 to 53
Log.error("Error when saving changes in \(uuid) session: \(error.localizedDescription)")
return nil
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've checked the call chain of the method and in the end the only error handling was this line of logging, so I moved it here and made the method not throw, to handle the nil cases conveniently from the client code

Copy link
Collaborator

Choose a reason for hiding this comment

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

Behold, useless error throwing. Good call 👍

Comment on lines +33 to +46
extension Future where Failure == Error {
convenience init(asyncOperation: @escaping () async throws -> Output) {
self.init { promise in
Task {
do {
let result = try await asyncOperation()
promise(.success(result))
} catch {
promise(.failure(error))
}
}
}
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using this to bridge Future client code and refactored async code to get rid of the callbacks

Comment on lines +6 to +21
extension Sequence {
func partitioned(by condition: (Element) -> Bool) -> (matching: [Element], nonMatching: [Element]) {
var matching = [Element]()
var nonMatching = [Element]()

for element in self {
if condition(element) {
matching.append(element)
} else {
nonMatching.append(element)
}
}

return (matching, nonMatching)
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Searched for some library that has this specifically but didn't find any

Copy link
Collaborator

@mpanuszewska mpanuszewska left a comment

Choose a reason for hiding this comment

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

I didn't go through the business logic fully, trusting you on that, but from technical side everything looks good. Good to see you getting super comfortable with swift 😏

Really good job 👏

Comment on lines +50 to 53
Log.error("Error when saving changes in \(uuid) session: \(error.localizedDescription)")
return nil
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Behold, useless error throwing. Good call 👍

@@ -0,0 +1,18 @@
struct BatchError: Error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool, there is 99% chance it will not be used ever again ^^'

@xameYeoh xameYeoh merged commit bd98ae8 into develop Jul 17, 2025
1 check failed
@xameYeoh xameYeoh deleted the fix/session-name-not-updated-after-change-on-another-device branch July 17, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments