Skip to content
Snippets Groups Projects
Unverified Commit f19eff92 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

fix(github): Reconcile entire GraphQL pages (#25311)

parent 782e5730
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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') },
},
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment