Esempio n. 1
0
    public override Task EventProcessingAsync(EventContext context)
    {
        if (!context.Event.IsError())
        {
            return(Task.CompletedTask);
        }

        var error = context.Event.GetError();

        if (error == null)
        {
            return(Task.CompletedTask);
        }

        if (String.IsNullOrWhiteSpace(context.Event.Message))
        {
            context.Event.Message = error.Message;
        }

        if (context.StackSignatureData.Count > 0)
        {
            return(Task.CompletedTask);
        }

        string[] commonUserMethods = { "DataContext.SubmitChanges", "Entities.SaveChanges" };
        if (context.HasProperty("CommonMethods"))
        {
            commonUserMethods = context.GetProperty <string>("CommonMethods").SplitAndTrim(new[] { ',' });
        }

        string[] userNamespaces = null;
        if (context.HasProperty("UserNamespaces"))
        {
            userNamespaces = context.GetProperty <string>("UserNamespaces").SplitAndTrim(new[] { ',' });
        }

        var signature = new ErrorSignature(error, userCommonMethods: commonUserMethods, userNamespaces: userNamespaces);

        if (signature.SignatureInfo.Count <= 0)
        {
            return(Task.CompletedTask);
        }

        var targetInfo     = new SettingsDictionary(signature.SignatureInfo);
        var stackingTarget = error.GetStackingTarget();

        if (stackingTarget?.Error?.StackTrace?.Count > 0 && !targetInfo.ContainsKey("Message"))
        {
            targetInfo["Message"] = stackingTarget.Error.Message;
        }

        error.Data[Error.KnownDataKeys.TargetInfo] = targetInfo;

        foreach (string key in signature.SignatureInfo.Keys)
        {
            context.StackSignatureData.Add(key, signature.SignatureInfo[key]);
        }

        return(Task.CompletedTask);
    }
        public override async Task EventProcessedAsync(EventContext context)
        {
            if (context.GetProperty("SetSessionStartEventId") != null)
            {
                await SetSessionStartEventIdAsync(context.Project.Id, context.Event.GetSessionId(), context.Event.Id).AnyContext();
            }

            await base.EventProcessedAsync(context).AnyContext();
        }
Esempio n. 3
0
        public override Task EventProcessedAsync(EventContext context)
        {
            if (context.GetProperty("SetSessionStartEventId") != null)
            {
                return(SetSessionStartEventIdAsync(context.Project.Id, context.Event.GetSessionId(), context.Event.Id));
            }

            return(Task.CompletedTask);
        }
        public override void Process(EventContext ctx) {
            if (ctx.StackInfo == null || !ctx.StackInfo.DateFixed.HasValue || ctx.StackInfo.DateFixed.Value >= ctx.Event.Date.UtcDateTime)
                return;

            Log.Trace().Message("Marking event as an regression.").Write();
            _stackRepository.MarkAsRegressed(ctx.StackInfo.Id);
            _eventRepository.MarkAsRegressedByStack(ctx.StackInfo.Id);

            string signatureHash = ctx.GetProperty<string>("__SignatureHash");
            _stackRepository.InvalidateCache(ctx.Event.StackId, signatureHash, ctx.Event.ProjectId);

            ctx.Event.IsFixed = false;
            ctx.IsRegression = true;
        }
Esempio n. 5
0
        public override void Process(EventContext ctx)
        {
            if (ctx.Stack == null || !ctx.Stack.DateFixed.HasValue || ctx.Stack.DateFixed.Value >= ctx.Event.Date.UtcDateTime)
            {
                return;
            }

            Log.Trace().Message("Marking event as an regression.").Write();
            _stackRepository.MarkAsRegressed(ctx.Stack.Id);
            _eventRepository.MarkAsRegressedByStack(ctx.Event.OrganizationId, ctx.Stack.Id);

            string signatureHash = ctx.GetProperty <string>("__SignatureHash");

            _stackRepository.InvalidateCache(ctx.Event.ProjectId, ctx.Event.StackId, signatureHash);

            ctx.Event.IsFixed = false;
            ctx.IsRegression  = true;
        }
        public override async Task EventProcessedAsync(EventContext context) {
            if (context.GetProperty("SetSessionStartEventId") != null)
                await SetSessionStartEventIdAsync(context.Project.Id, context.Event.GetSessionId(), context.Event.Id).AnyContext();

            await base.EventProcessedAsync(context);
        }