-
Notifications
You must be signed in to change notification settings - Fork 450
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
Fix for ISO string modification during function metadata binding parsing #10735
base: dev
Are you sure you want to change the base?
Conversation
@@ -244,13 +247,26 @@ internal IEnumerable<FunctionMetadata> ValidateMetadata(IEnumerable<RawFunctionM | |||
return validatedMetadata; | |||
} | |||
|
|||
private static BindingMetadata GetBindingMetadata(string binding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be CreateBindingMetadata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can the private method be underneath the internal methods?
using (StringReader stringReader = new StringReader(binding)) | ||
using (JsonTextReader jsonTextReader = new JsonTextReader(stringReader)) | ||
{ | ||
JsonSerializer serializer = JsonSerializer.Create(_jsonSerializerSettings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we DI the JsonSerializer so we're not creating one every time this method is called?
@@ -28,6 +30,7 @@ internal class WorkerFunctionMetadataProvider : IWorkerFunctionMetadataProvider | |||
private readonly IScriptHostManager _scriptHostManager; | |||
private string _workerRuntime; | |||
private ImmutableArray<FunctionMetadata> _functions; | |||
private static JsonSerializerSettings _jsonSerializerSettings = new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we setup the serializer + settings as part of the ctor?
@@ -10,3 +10,4 @@ | |||
- [Added net9 prelaunch app.](https://github.com/Azure/azure-functions-dotnet-worker/pull/2898) | |||
- Update the `DefaultHttpProxyService` to better handle client disconnect scenarios (#10688) | |||
- Replaced `InvalidOperationException` with `HttpForwardingException` when there is a ForwarderError | |||
- Fix the accidental modification of ISO strings during function metadata binding parsing. This fixes the listener errors related to the CosmosDB trigger's `StartFromTime` parameter. (#10735) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix the accidental modification of ISO strings during function metadata binding parsing. This fixes the listener errors related to the CosmosDB trigger's `StartFromTime` parameter. (#10735) | |
- Fix modification of ISO strings during the parsing of function metadata bindings. | |
- This fixes the listener errors related to the CosmosDB trigger's `StartFromTime` parameter. (#10735) |
Issue describing the changes in this PR
resolves #10732 (and Azure/azure-functions-dotnet-worker#2882)
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-proc
branch to be included in Core Tools and non-Flex deployments.in-proc
branch is not requiredrelease_notes.md
Additional information
Tested locally E2E the following scenarios:
StartFromTime
set to a past time started triggering and processing existing records immediately after startup (older records than start time untouched)StartFromTime
set to a future date and will process any new changes following startup. Discussed with original engineers - this feature was only meant to go into the past, so there was never a design set for future dates. This setting will not ignore changes until that future date (note: need to test InProc to see if behavior is the same there).