vmanot / Merge

An extension to Combine.
MIT License
9 stars 7 forks source link

os_unfair_lock_lock when used with NetworkKit #4

Closed siddharth952 closed 10 months ago

siddharth952 commented 1 year ago

If a network call fails for some reason then it causes os_unfair_lock_lock(base).

eg. Use of @ReactorRepository() var repository: UserRepository

public func registerDevice() -> AnyPublisher<GenericRequestResponse, Error> {
        return serverSession
            .task(with: .registerDevice)
            .successPublisher
            .tryMap({ try $0.unwrap(GenericRequestResponse.self) })
            .eraseToAnyPublisher()
    }

        func task(for action: Action) -> ActionTask {
        switch action {
        case .registerDevice: do {
            return repository.registerDevice()
                // .receiveOnMainQueue() Adding this is also not helping
                .eraseToActionTask()
        }

This is due to usage (Merge package's ) sinkResult. As earlier removing it used to help get rid of this problem at other places.

Reactor Commit Used: 50cfa48 Merge Commit Used: 37ebf4b

siddharth952 commented 1 year ago

Stack trace Screenshot 2023-09-22 at 11 35 37 AM

fampaySiddharth commented 1 year ago

Any updates on the same?

vmanot commented 10 months ago

This should be fixed now, please reopen if you encounter it again.