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

Remote Config not pulling latest configuration without hard cache reload on web #8233

Closed
enterprisecoderr opened this issue May 8, 2024 · 6 comments

Comments

@enterprisecoderr
Copy link

Operating System

macOS 14.4.1 (23E224)

Browser Version

Version 124.0.6367.62 (Official Build) (arm64)

Firebase SDK Version

10.11.1

Firebase SDK Product:

Remote-Config

Describe your project's tooling

Nx based stencil project building MFEs. There is a class utilized as a generic service that gets remote configurations from firebase, that is pulled into the MFEs and other clients like angular apps

Describe the problem

The problem is that when I update firebase remote config and do a simple refresh multiple times, the latest config is not pulled. I am using the fetch and activate functions to get the remote config. I have to do a hard cache reload to see the latest config. Is there a cache setting I can toggle in addition to the minimumfetchtimeintervalmillis?

Steps and code to reproduce issue

  1. Setup remote config in a js class that calls fetch and activate and sets the remote config minimumFetchTimeIntervalMillis to 0
  2. Use that remote config service class in a stencil component
  3. Pull a remote configuration parameter and log it to the console
  4. Update the remote configuration
  5. Refresh the page and see if the logged config changed. The current behavior is that it doesn't
@enterprisecoderr enterprisecoderr added new A new issue that hasn't be categoirzed as question, bug or feature request question labels May 8, 2024
@google-oss-bot
Copy link
Contributor

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

@aalej aalej added needs-attention api: remoteconfig and removed needs-triage new A new issue that hasn't be categoirzed as question, bug or feature request labels May 8, 2024
@jbalidiong
Copy link
Contributor

Hi @enterprisecoderr, thanks for reaching out to us. I'm wasn't able to reproduce the behavior that you've mentioned. I tried fetchAndActivate() using the ff:

  1. Edit the src/app/app.tsx to be:
const remoteConfig = getRemoteConfig(app);

remoteConfig.settings.minimumFetchIntervalMillis = 0;
fetchAndActivate(remoteConfig)
.then(()=>{
  const value = getValue(remoteConfig, "someKey")
  .asString()
  console.log(`Value: ${value}`);

})
  1. Run npm run start
  2. Visit the http://localhost:4200/
  3. Update the remote config value in the console
  4. Refresh the page and get the updated value.

To get a better understanding of what’s causing the failed fetch, could you provide a minimal, but complete sample of a project that I can run locally.

@enterprisecoderr
Copy link
Author

I am not using the bundled fetchAndActivate command. I'm calling activate and then later fetchConfig. Can you try with that setup?

@jbalidiong
Copy link
Contributor

Hi @enterprisecoderr, I tried using the fetchConfig and activate but I still wasn't able to replicate the behavior. Here is the sample snippet of my code:

fetchConfig(remoteConfig)
.then(()=>{
  activate(remoteConfig)
.then(()=>{
    const value = getValue(remoteConfig, "someKey")
    .asString()
    console.log(`Value: ${value}`);
  
  })
.catch((error)=>{
    console.log(error)
  });
})
.catch((error)=>{
  console.log(error)
});

I used .then() and called activate() to avoid any race condition as both activate and fetchConfig returns a promise. Could you try following the implementation and see if the behavior persists.

@google-oss-bot
Copy link
Contributor

Hey @enterprisecoderr. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@enterprisecoderr if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants