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

Memory Leaks issue using .whereField(_, isEqualTo:) #12732

Closed
holmeso983 opened this issue Apr 9, 2024 · 3 comments
Closed

Memory Leaks issue using .whereField(_, isEqualTo:) #12732

holmeso983 opened this issue Apr 9, 2024 · 3 comments

Comments

@holmeso983
Copy link

Description

The Issue

I'm currently receiving mutiple memory leaks when using the .whereField(, isEqualTo:) in one of my functions. The happens no where else in my code other than here, which is quite confusing. When I remove just the .whereField(, isEqualTo:) line, I have no issues.

The Code:

static func getManyFromProject(_ project: Project, topLevelCategoryID: String?, sortByDateAdded: Bool = false, limit: Int = 10) async -> Result<[InventoryItem], Error> {
        do {
            // 1. Base query setup for project items
            var baseQuery: Query = FirebaseService.shared.database
                .collection("companies")
                .document("123456")
                .collection(Collections.inventory.rawValue)
            // Apply project filter
                .whereField("projectID", isEqualTo: project.objectID)   // MARK: MEMORY LEAK HERE
            
            // Execute the base query
            let allProjectItems: [InventoryItem] = try await FirebaseService.shared.getMany(with: baseQuery).get()
 
            return .success(allProjectItems)
        } catch let error {
            return .failure(error)
        }
    }

Logs

Screenshot 2024-04-09 at 3 13 43 PM

Screenshot 2024-04-09 at 3 14 29 PM

Reproducing the issue

No response

Firebase SDK Version

10.23.1

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Database, Storage

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@jesus-mg-ios
Copy link

Yas, Same error here, workaround trying to not use whereField ...

@MarkDuckworth
Copy link
Contributor

Thanks for the report and the sample code. I'm going to close this as a duplicate of #12613. The team is working on a fix, but I will also share this report.

@MarkDuckworth MarkDuckworth closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
@firebase firebase locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants