Skip to content

1.9.1

Compare
Choose a tag to compare
@github-actions github-actions released this 21 Mar 11:08
· 225 commits to refs/heads/develop since this release
ff53f97

Summary

In this release we fix an issue that was causing a System.InvalidCastException exception when decorating with the Tracing attribute generic methods that would be called with different T as parameters or return T.

Thank you @Kuling for reporting the issue.

using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Core;
using AWS.Lambda.Powertools.Tracing;

[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]

namespace MyFunction
{
    public interface ISampleService
    {
        Task<T> LoadAsync<T>(T query);
    }

    [Tracing]
    public class SampleService : ISampleService
    {
        public async Task<T> LoadAsync<T>(T query)
        {
            return default;
        }
    }

    [Tracing]
    public class Function
    {
        public async Task<APIGatewayProxyResponse> FunctionHandlerAsync(APIGatewayProxyRequest request, ILambdaContext context)
        {
            var target = new SampleService();
            await target.LoadAsync<double>(3.4);
            await target.LoadAsync<int>(5); // Bug

            return null;
        }
    }
}

Changes

📜 Documentation updates

  • chore(docs): Update docs and add supported runtimes (#569) by @hjgraca

🐛 Bug and hot fixes

  • fix: Error when decorating duplicate generic method - Tracing (#572) by @hjgraca

🔧 Maintenance

  • chore(docs): Update docs and add supported runtimes (#569) by @hjgraca

This release was made possible by the following contributors:

@Kuling and @hjgraca