Skip to content

ApolloClient doesn't use the provided callbackQueue in clearCache. #1900

@iresslerCMM

Description

@iresslerCMM

Bug report

The ApolloClient's implementation of clearCache(callbackQueue:completion:) from ApolloClientProtocol does not use the callbackQueue.

It is currently implemented like this:

public func clearCache(callbackQueue: DispatchQueue = .main,
                       completion: ((Result<Void, Error>) -> Void)? = nil) {
  self.store.clearCache(completion: completion)
}

Which drops the callbackQueue without ever using it.

I would expect the implementation to be like this:

public func clearCache(callbackQueue: DispatchQueue = .main,
                       completion: ((Result<Void, Error>) -> Void)? = nil) {
  self.store.clearCache(callbackQueue: callbackQueue, completion: completion)
}

Versions

Please fill in the versions you're currently using:

  • apollo-ios SDK version: 0.45.0 (But wasn't changed in 0.46.0 from what I can see)
  • Xcode version: All
  • Swift version: All
  • Package manager: SPM

Steps to reproduce

Call

ApolloStore.clearCache(callbackQueue:completion:)

with a callbackQueue that is not .main.

Further details

If this is correct and I'm not missing anything I'm happy to submit a PR with my proposed change (or something different if I'm missing a better solution).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions