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

[VERSION_MISMATCH]: No If-Match header found on UpdateRemoteConfig call #425

Open
stillie opened this issue Jul 8, 2022 · 6 comments
Open

Comments

@stillie
Copy link

stillie commented Jul 8, 2022

When calling remoteConfigApi.projects.updateRemoteConfig(updatedRemoteConfigValue, projectName); i am receiving the above error.

In my investigation and trial and error i found that adding headers.putIfAbsent("If-Match", () => "etag-{ProjectNumber}-{CurrentVersion}"); to the below file at the below line fixed the issue

Currently there is no way to add the etag to the call when updating a remote config value

{ProjectNumber} = The firebase project number
{CurrentVersion} = The current version of the change

@stillie
Copy link
Author

stillie commented Jul 8, 2022

There was a similar issue found here for PHP googleapis/google-api-php-client-services#309

@stillie
Copy link
Author

stillie commented Jul 19, 2022

Is anyone able to look at this? :(

@kevmoo
Copy link
Collaborator

kevmoo commented Sep 15, 2022

An idea: wrap the Client you pass to the API using a custom https://pub.dev/documentation/http/latest/http/BaseClient-class.html

Override side to create a new request with the header you want.

We could add some extra helpers here to make things easier...would need to investigate.

@kevmoo
Copy link
Collaborator

kevmoo commented Sep 15, 2022

So weird. This is the ONLY API I can see that has this restriction. Hrm...

@stillie
Copy link
Author

stillie commented Sep 21, 2022

The problem with that @kevmoo is that i need to attach a version to the header without knowing what the current version is when i create the client initiallly?

@stillie
Copy link
Author

stillie commented Sep 21, 2022

Here is an example of what i attempted with your suggestion around the BaseClient:

Disclaimer: Don't judge me by the code, this is just setting up a POC.

https://gist.github.com/stillie/562cb86b16345a382bf0edc1788f7521

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

2 participants