2023-07-27 15:14:09.5670 [INFO] [DocIntel.Core.Importers.RSSSourceImporter] Collecting RSS feed for 'Example' (870175bc-f9c7-402b-96cd-ceb8ac506ecf)
2023-07-27 15:14:09.5755 [ERROR] [DocIntel.Services.Importer.Runner] System.InvalidOperationException
2023-07-27 15:14:09.5755 [ERROR] [DocIntel.Services.Importer.Runner] Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.Max[TSource,TResult](IEnumerable`1 source, Func`2 selector)
at DocIntel.Core.Importers.RSSSourceImporter.PullAsync(Nullable`1 lastPull, Int32 limit)+MoveNext() in /src/DocIntel.Core/Importers/RSSSourceImporter.cs:line 154
at DocIntel.Core.Importers.RSSSourceImporter.PullAsync(Nullable`1 lastPull, Int32 limit)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at DocIntel.Services.Importer.Runner.CollectFeed(Importer feed, AmbientContext feedContext) in /src/DocIntel.Services.Importer/Runner.cs:line 137
at DocIntel.Services.Importer.Runner.CollectFeed(Importer feed, AmbientContext feedContext) in /src/DocIntel.Services.Importer/Runner.cs:line 137
at DocIntel.Services.Importer.Runner.ImportFeeds() in /src/DocIntel.Services.Importer/Runner.cs:line 102
at DocIntel.Services.Importer.Runner.RunAsync(CancellationToken cancellationToken) in /src/DocIntel.Services.Importer/Runner.cs:line 80
Analysis of the issue:
in DocIntel.Core\Importers\RSSSourceImporter.cs
line 139: rssMetadata.LastPull = feed.Items.Max(_ => _.PublishDate).DateTime;
=> there should be a check if feed.Items is empty or not before executing this line
When the RSS importer runs on an empty RSS feed (which can happen), it fails and it cannot process the other RSS feeds.
Example of empty RSS feeds:
Stack trace:
Analysis of the issue:
=> there should be a check if feed.Items is empty or not before executing this line