You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre-built SDK from the website or open-source from this repo: open-source
Firebase C++ SDK version: 11.3.0
Main Firebase Components in concern: App
Other Firebase Components in use: Auth, Firestore
Platform you are using the C++ SDK on: Windows
Platform you are targeting: Desktop
[REQUIRED] Please describe the question here:
On macOS it's possible to override the application support directory as part of your testing suite, which in turn modifies where firebase files get stored. On Windows it looks like the SDK is using the known folder apis (
) which is problematic when we're trying to do automated integration testing since we'd ideally like to override this folder to provide a clean slate for each test and it seems like that this machinery prevents that.
Do you have any advice on how to work around this, or if there is some other way to change the parent directory here in the testing scenario.
The text was updated successfully, but these errors were encountered:
Hi @brianmichel. At the moment there is no way to configure the directory into which Firestore writes its information. I've opened up an internal feature request ticket for this request though (b/319104045). I have to be honest, though, that the likelihood of it getting implemented is low due to competing team priorities.
As you discovered, Firestore on Windows uses a subdirectory of the user's "LocalAppData" directory. On macOS it uses a subdirectory of NSApplicationSupportDirectory. If you'd like to see the low-level details, the function LevelDbOpener::FirestoreAppDataDir() is where the decision is actually made (link). It uses a utility class called "FileSystem" with a Windows implementation, macOS/iOS implementation, and Linux implementation. If you turn on Firestore debug logging, the logs will include the full directory used.
For your specific use case, you could manually delete this directory in between tests. Alternately, you could call Firestore.clearPersistence() before running each test. This isn't quite the same as an empty directory but it's pretty close.
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the question here:
On macOS it's possible to override the application support directory as part of your testing suite, which in turn modifies where firebase files get stored. On Windows it looks like the SDK is using the known folder apis (
firebase-cpp-sdk/app/src/filesystem_desktop_windows.cc
Line 185 in 7b5adbe
Do you have any advice on how to work around this, or if there is some other way to change the parent directory here in the testing scenario.
The text was updated successfully, but these errors were encountered: