Skip to content

Failed to register redirect on moved page due to lack of history #169

@EricCeric

Description

@EricCeric

Hi

Been using the Geta.NotFoundHandler.Optimizely 5.0.13 and see a lot of background activites that fails when an editor moves a page from one structure to a new with the AutomaticRedirectsEnabled enabled:

{"Timestamp":"2025-04-25T16:13:47.5892281+02:00","Level":"Error","MessageTemplate":"Failed registering redirects for content: {ContentLink}","Exception":"System.InvalidOperationException: Sequence contains no elements\r\n at System.Linq.ThrowHelper.ThrowNoElementsException()\r\n at System.Linq.Enumerable.First[TSource](IEnumerable1 source)\r\n at Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.RedirectBuilder.CreateRedirects(IReadOnlyCollection1 histories)\r\n at Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.DefaultAutomaticRedirectsService.CreateRedirects(IReadOnlyCollection`1 histories)\r\n at Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.MovedContentRegistratorBackgroundService.CreateRedirects(ContentReference contentLink)\r\n at Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.MovedContentRegistratorBackgroundService.ExecuteAsync(CancellationToken stoppingToken)","Properties":{"ContentLink":"43677","SourceContext":"Geta.NotFoundHandler.Optimizely.Core.AutomaticRedirects.MovedContentRegistratorBackgroundService"}}

Seems to be failing if there exists no history since before? Not sure if designed like this by intention but our customers are bringing this plugin from scratch with not histories since before

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions