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

refactor(github): Remove unused `etag` support for PR cache (#17665)

parent 70476774
No related branches found
No related tags found
No related merge requests found
......@@ -205,23 +205,4 @@ describe('modules/platform/github/api-cache', () => {
expect(needNextPage).toBeFalse();
});
});
describe('etag', () => {
it('returns null', () => {
const apiCache = new ApiCache({ items: {} });
expect(apiCache.etag).toBeNull();
});
it('sets and retrieves non-null value', () => {
const apiCache = new ApiCache({ items: {} });
apiCache.etag = 'foobar';
expect(apiCache.etag).toBe('foobar');
});
it('deletes value for null parameter', () => {
const apiCache = new ApiCache({ items: {} });
apiCache.etag = null;
expect(apiCache.etag).toBeNull();
});
});
});
......@@ -5,18 +5,6 @@ import type { ApiPageCache, ApiPageItem } from './types';
export class ApiCache<T extends ApiPageItem> {
constructor(private cache: ApiPageCache<T>) {}
get etag(): string | null {
return this.cache.etag ?? null;
}
set etag(value: string | null) {
if (value === null) {
delete this.cache.etag;
} else {
this.cache.etag = value;
}
}
/**
* @returns Date formatted to use in HTTP headers
*/
......
......@@ -145,5 +145,4 @@ export interface ApiPageItem {
export interface ApiPageCache<T extends ApiPageItem = ApiPageItem> {
items: Record<number, T>;
lastModified?: string;
etag?: string;
}
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