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
PluginUUIDBase's force_new_uuid option seems broken #15
Comments
Thinking about this, why is |
Hey, thanks for opening this ticket. Indeed that's a bug. I'll fix this within a few days. |
0.2.3 is published. Please try again and let me know if it's all good now. |
Looks good from here! Thank you for the quick fix. FTR my workaround was: # Fix https://github.com/tomwojcik/starlette-context/issues/15
__original_extract_value_from_header_by_key = (
PluginUUIDBase.extract_value_from_header_by_key)
async def __patched_extract_value_from_header_by_key(self, request):
self.value = None
return await __original_extract_value_from_header_by_key(self, request)
PluginUUIDBase.extract_value_from_header_by_key = (
__patched_extract_value_from_header_by_key
) Removing this from my code, and using |
Awesome! Thanks for checking that out. |
When using
PluginUUIDBase
'sforce_new_uuid
option and setting it toTrue
I'm always getting the sameuuid
. Which is the opposite of what I expect.It looks like when
self.value is None
a newuuid
is generated, and this works fine when for the first request. But subsequent request seem to be using the same id.I suspect the code that needs to be fixed is missing a
self.value = None
before trying anything else here:starlette-context/starlette_context/plugins/plugin_uuid.py
Line 34 in 2f80262
The text was updated successfully, but these errors were encountered: