firebase / firebase/firebase-ios-sdk

[FR]: Disable warning [I-FST000002]: Attempting to initialize or set a @DocumentID property with a non-nil value

Open
#14,475 8 comments 0 reactions 1 assignee Assigned to @peterfriese View on GitHub
api: firestore Swift API type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description

For many of my applications I use Structs, that I also use for Firebase (`Codable`), to feed Views in SwiftUI.
For testing cases and other reasons, sometimes it is important for me to create static instances of those types e.g. `unknown` or `placeholder`. And to not trigger unexpected behavior I assign those static instances an ID, just to not break SwiftUI code.
However every time those static instances are initialized, I get this warning in the console

> 11.8.1 - [FirebaseFirestore][I-FST000002] Attempting to initialize or set a @ DocumentID property with a non-nil value: "placeholder". The document ID is managed by Firestore and any initialized or set value will be ignored. The ID is automatically set when reading from Firestore.

I surely know about the stated behavior and would like to not get that warning all the time, since it is a large portion of my console logs.

### API Proposal

I would appreciate a way to suppress those warnings either by an environment variable, Info.plist key or from within the code.

### Firebase Product(s)

Firestore

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.