diff --git a/lib/util/github/graphql/cache-strategies/abstract-cache-strategy.ts b/lib/util/github/graphql/cache-strategies/abstract-cache-strategy.ts index 98ddffcd3f342f24d4a6ac7ee2520b00d6d70428..1b8a1288026b01d0c78d6b7aae27797c7bf6040c 100644 --- a/lib/util/github/graphql/cache-strategies/abstract-cache-strategy.ts +++ b/lib/util/github/graphql/cache-strategies/abstract-cache-strategy.ts @@ -110,9 +110,13 @@ export abstract class AbstractGithubGraphqlCacheStrategy< // If we reached previously stored item that is stabilized, // we assume the further pagination will not yield any new items. + // + // However, we don't break the loop here, allowing to reconcile + // the entire page of items. This protects us from unusual cases + // when release authors intentionally break the timeline. Therefore, + // while it feels appealing to break early, please don't do that. if (oldItem && this.isStabilized(oldItem)) { isPaginationDone = true; - break; } // Check if item is new or updated diff --git a/lib/util/github/graphql/cache-strategies/memory-cache-strategy.spec.ts b/lib/util/github/graphql/cache-strategies/memory-cache-strategy.spec.ts index 4dcf3d1ac7927a04d5efbf511aa0b443dc360095..5d693996290f0385a2442b0251f84d50ead67ce4 100644 --- a/lib/util/github/graphql/cache-strategies/memory-cache-strategy.spec.ts +++ b/lib/util/github/graphql/cache-strategies/memory-cache-strategy.spec.ts @@ -133,7 +133,7 @@ describe('util/github/graphql/cache-strategies/memory-cache-strategy', () => { expect(isPaginationDone).toBe(true); }); - it('reconciles only not stabilized items in page', async () => { + it('reconciles entire page', async () => { const oldItems = { '1': { releaseTimestamp: isoTs('2020-01-01 00:00'), version: '1' }, '2': { releaseTimestamp: isoTs('2020-01-01 01:00'), version: '2' }, @@ -161,9 +161,9 @@ describe('util/github/graphql/cache-strategies/memory-cache-strategy', () => { expect(isPaginationDone).toBe(true); expect(memCache.get('github-graphql-cache:foo:bar')).toMatchObject({ items: { - '1': { releaseTimestamp: isoTs('2020-01-01 00:00') }, - '2': { releaseTimestamp: isoTs('2020-01-01 01:00') }, - '3': { releaseTimestamp: isoTs('2020-01-01 02:00') }, + '1': { releaseTimestamp: isoTs('2022-12-31 10:00') }, + '2': { releaseTimestamp: isoTs('2022-12-31 11:00') }, + '3': { releaseTimestamp: isoTs('2022-12-31 12:00') }, '4': { releaseTimestamp: isoTs('2022-12-31 13:00') }, }, });