-
Notifications
You must be signed in to change notification settings - Fork 986
Description
Operating System
MacOS Sonoma 14.3
Browser Version
Chrome Version 123.0.6312.124 (Official Build) (arm64)
Firebase SDK Version
0.9.27
Firebase SDK Product:
Remote-Config
Describe your project's tooling
Stencil Application with webpack.
Versions of the firebase deps:
"@firebase/app": "0.9.27",
"@firebase/remote-config": "0.4.6",
Describe the problem
I am unable to get all parameters from remote config when using it inside my stencil appllication
Steps and code to reproduce issue
I create a firebase app with the following code. Ignore any missing imports as they are hidden intentionally. No compilation issues just runtime issues.
import { initializeApp } from '@firebase/app';
export const app = initializeApp(...);
I then utilize the app to get the remote config object in this remote config service
import { FirebaseApp } from '@firebase/app';
import { RemoteConfig, Value, activate, fetchConfig, getAll, getRemoteConfig, getString, getValue } from '@firebase/remote-config';
import { WEB_REMOTE_CONFIG_NAME } from '../constants/FIREBASE';
import { FirebaseService} from './firebase.service';
export class RemoteConfigService {
initialized: boolean;
private firebaseApp?: FirebaseApp;
private remoteConfig?: RemoteConfig;
constructor(private firebaseService: FirebaseService) {
this.initialized = false;
this.init();
}
public async init(): Promise<void> {
this.firebaseApp = this.firebaseService.getFirebaseApp();
this.remoteConfig = getRemoteConfig(this.firebaseApp);
await this.activeLastAndFetchLatestForNextLogin();
this.setConfigSettings();
this.initialized = true;
}
private setConfigSettings() {
const inProd = true;
if (inProd) {
this.remoteConfig.settings.minimumFetchIntervalMillis = 0;
}
}
private async activeLastAndFetchLatestForNextLogin(): Promise<void> {
if (this.remoteConfig) {
await activate(this.remoteConfig);
await fetchConfig(this.remoteConfig);
if (this.remoteConfig.lastFetchStatus === 'failure') {
this.logger.error('Failed to fetch latest firebase remote config');
}
}
}
}
export const defaultRemoteConfigService = new RemoteConfigService(new LoggerFactory(), defaultFirebaseService);
Upon checking the firebase_remote_config.app_namespace_store table in indexedDB under the Application tab in the chrome browser, all the remote config parameters are not shown, which is inconsistent with what I see inside the firebase console