github-issue-tower-defence-management 1.117.2 → 1.117.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>TDPM Console</title>
7
- <script type="module" crossorigin src="/assets/index-CJJsRF8i.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BXcfEKkX.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-DGVKvwux.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "1.117.2",
3
+ "version": "1.117.3",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -53,24 +53,26 @@ describe('useConsoleDetailPrefetch', () => {
53
53
  jest.useRealTimers();
54
54
  });
55
55
 
56
- it('prefetches the next items after the idle defer elapses', () => {
56
+ it('is disabled and schedules no prefetch for issue items', () => {
57
57
  const caches = buildCaches();
58
58
  const bodyPrefetch = jest.spyOn(caches.body, 'prefetch');
59
+ const statePrefetch = jest.spyOn(caches.state, 'prefetch');
60
+ const commentsPrefetch = jest.spyOn(caches.comments, 'prefetch');
59
61
  const relatedPrefetch = jest.spyOn(caches.relatedPrs, 'prefetch');
60
62
  const items = [makeItem(1), makeItem(2), makeItem(3)];
61
63
  renderHook(() => useConsoleDetailPrefetch(caches, items[0], items));
62
-
63
- expect(bodyPrefetch).not.toHaveBeenCalled();
64
64
  jest.runAllTimers();
65
65
 
66
- expect(bodyPrefetch).toHaveBeenCalledWith('o/r#2', items[1].url);
67
- expect(bodyPrefetch).toHaveBeenCalledWith('o/r#3', items[2].url);
68
- expect(relatedPrefetch).toHaveBeenCalledWith('o/r#2', items[1].url);
66
+ expect(bodyPrefetch).not.toHaveBeenCalled();
67
+ expect(statePrefetch).not.toHaveBeenCalled();
68
+ expect(commentsPrefetch).not.toHaveBeenCalled();
69
+ expect(relatedPrefetch).not.toHaveBeenCalled();
69
70
  });
70
71
 
71
- it('prefetches PR resources for pull request items', () => {
72
+ it('is disabled and schedules no prefetch for pull request items', () => {
72
73
  const caches = buildCaches();
73
74
  const filesPrefetch = jest.spyOn(caches.files, 'prefetch');
75
+ const commitsPrefetch = jest.spyOn(caches.commits, 'prefetch');
74
76
  const prStatusPrefetch = jest.spyOn(caches.prStatus, 'prefetch');
75
77
  const items = [
76
78
  makeItem(1),
@@ -79,20 +81,9 @@ describe('useConsoleDetailPrefetch', () => {
79
81
  renderHook(() => useConsoleDetailPrefetch(caches, items[0], items));
80
82
  jest.runAllTimers();
81
83
 
82
- expect(filesPrefetch).toHaveBeenCalledWith('o/r#2', items[1].url);
83
- expect(prStatusPrefetch).toHaveBeenCalledWith('o/r#2', items[1].url);
84
- });
85
-
86
- it('limits prefetch to the next ten items', () => {
87
- const caches = buildCaches();
88
- const bodyPrefetch = jest.spyOn(caches.body, 'prefetch');
89
- const items = Array.from({ length: 15 }, (_unused, index) =>
90
- makeItem(index + 1),
91
- );
92
- renderHook(() => useConsoleDetailPrefetch(caches, items[0], items));
93
- jest.runAllTimers();
94
-
95
- expect(bodyPrefetch).toHaveBeenCalledTimes(10);
84
+ expect(filesPrefetch).not.toHaveBeenCalled();
85
+ expect(commitsPrefetch).not.toHaveBeenCalled();
86
+ expect(prStatusPrefetch).not.toHaveBeenCalled();
96
87
  });
97
88
 
98
89
  it('does nothing when no item is selected', () => {
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
2
2
  import type { ConsoleListItem } from '../logic/types';
3
3
  import type { ConsoleCaches } from './useConsoleCaches';
4
4
 
5
- const PREFETCH_AHEAD_COUNT = 10;
5
+ const PREFETCH_AHEAD_COUNT = 0;
6
6
  const PREFETCH_DEFER_MS = 500;
7
7
  const PREFETCH_IDLE_TIMEOUT_MS = 2000;
8
8