pi-odd-worktree 3.9.2 → 3.10.0
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.
- package/README.md +63 -40
- package/extensions/odd-worktree-tools.ts +859 -12
- package/lib/gh-issues.js +65 -10
- package/lib/gh-prs.js +2011 -0
- package/lib/issue-preview.js +70 -4
- package/lib/issues-cache-store.js +4 -1
- package/lib/issues-section.js +346 -23
- package/lib/issues-view.js +116 -5
- package/lib/pr-preview.js +353 -0
- package/lib/prs-rail-store.js +317 -0
- package/lib/prs-view.js +2896 -0
- package/package.json +1 -1
- package/tools/files-bridge.test.js +2 -2
- package/tools/files-command.test.js +1 -1
- package/tools/fixtures/gh-pr-connection-page.json +84 -0
- package/tools/fixtures/gh-pr-metadata.json +29 -0
- package/tools/fixtures/gh-pr-rail.json +61 -0
- package/tools/fixtures/gh-pr-search-page.json +82 -0
- package/tools/fixtures/gh-pr-view.json +159 -0
- package/tools/gh-issues.test.js +4 -2
- package/tools/gh-prs.test.js +1828 -0
- package/tools/issue-preview.test.js +119 -0
- package/tools/issues-cache-store.test.js +2 -2
- package/tools/issues-command.test.js +10 -3
- package/tools/issues-open-guard.test.js +15 -0
- package/tools/issues-section.test.js +618 -9
- package/tools/issues-view.test.js +297 -0
- package/tools/package-surface.test.js +18 -4
- package/tools/pr-preview.test.js +281 -0
- package/tools/prs-command.test.js +1280 -0
- package/tools/prs-rail-store.test.js +343 -0
- package/tools/prs-t10-safety.test.js +326 -0
- package/tools/prs-t12-safety.test.js +348 -0
- package/tools/prs-t13-independent.test.js +378 -0
- package/tools/prs-t14-safety.test.js +340 -0
- package/tools/prs-t15-independent.test.js +259 -0
- package/tools/prs-t18-safety.test.js +217 -0
- package/tools/prs-t7-safety.test.js +127 -0
- package/tools/prs-view.test.js +1462 -0
|
@@ -41,6 +41,16 @@
|
|
|
41
41
|
// nowhere;
|
|
42
42
|
// - `refreshIfStale(maxAgeMs)` is the activity seam: one read for an absent or
|
|
43
43
|
// aged snapshot, nothing for a fresh one, one in flight, or a disposed one;
|
|
44
|
+
// - the rail's SECOND read is the repository's pull requests (S4/S5, T4):
|
|
45
|
+
// `loadPullRequests` answers `{ ok, mine, review }`, the header reads
|
|
46
|
+
// `<n> issues · <m> pr` with `m` the distinct numbers in mine ∪ review (`<n>
|
|
47
|
+
// issues` alone while that read is unavailable, `· stale` kept), the read
|
|
48
|
+
// obeys the same TTL, the same self-scheduled floor and the same drawn window
|
|
49
|
+
// as the issues read, never blocks a frame, and a failed read keeps the last
|
|
50
|
+
// count. A row whose issue has a linked pull request sends its click to
|
|
51
|
+
// `open(number, { pullRequest, pullRequestBucket })` — `review` beats `mine`,
|
|
52
|
+
// and a pull request in neither is `all` — while every other row keeps the
|
|
53
|
+
// four arguments it always had; DEFAULT_ROW_LABEL is `github` (S4),
|
|
44
54
|
// - the three states are rows (`loading…`, `no open issues`, ONE error row),
|
|
45
55
|
// never a throw;
|
|
46
56
|
// - the extension reaches the rail ONLY through gentle-shell-bridge's
|
|
@@ -1116,6 +1126,341 @@ test('S5: loading, empty and error are rows, never a throw', async () => {
|
|
|
1116
1126
|
'a throwing read is ONE error row, not a throw');
|
|
1117
1127
|
});
|
|
1118
1128
|
|
|
1129
|
+
// ---------------------------------------------------------------------------
|
|
1130
|
+
// T4 (S4, S5): the rail's second read — the checkout repository's pull requests.
|
|
1131
|
+
//
|
|
1132
|
+
// `loadPullRequests` is the seam T5 provides, shaped like
|
|
1133
|
+
// `listRailPullRequests`: `{ ok, mine, review }`, each row a
|
|
1134
|
+
// `{ number, linkedIssues }`. It decides exactly two things: the header's `pr`
|
|
1135
|
+
// count (the DISTINCT numbers in mine ∪ review) and which PR panel a row's click
|
|
1136
|
+
// opens. It is a read like the issues one — same TTL, same self-scheduled floor,
|
|
1137
|
+
// same drawn window, never awaited by a frame — and a failed read keeps the last
|
|
1138
|
+
// count, because a `gh` killed by its bound must never cost the human a number it
|
|
1139
|
+
// already had.
|
|
1140
|
+
// ---------------------------------------------------------------------------
|
|
1141
|
+
|
|
1142
|
+
// The two buckets as the seam answers them. A bare number is a row with no linked
|
|
1143
|
+
// issues, which is what most of these tests need.
|
|
1144
|
+
function railBuckets({ mine = [], review = [] } = {}) {
|
|
1145
|
+
const row = (entry) => (typeof entry === 'number' ? { number: entry, linkedIssues: [] } : entry);
|
|
1146
|
+
return { ok: true, mine: mine.map(row), review: review.map(row) };
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
function railPullRequests(buckets, onRead = null) {
|
|
1150
|
+
return async () => {
|
|
1151
|
+
if (onRead !== null) onRead();
|
|
1152
|
+
return railBuckets(buckets);
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
// S4: `n issues · n pr` is the one header the human asked for, and `pr` counts
|
|
1157
|
+
// the distinct numbers in the union of the two buckets the rail reads — a pull
|
|
1158
|
+
// request that is both mine and awaiting my review is ONE pr.
|
|
1159
|
+
test('S4 (T4): the header reads `n issues · m pr`, m the distinct pull requests in mine ∪ review', async () => {
|
|
1160
|
+
const handle = createIssuesSection({
|
|
1161
|
+
load: readyLoad(issueList(2)),
|
|
1162
|
+
loadPullRequests: railPullRequests({ mine: [69, 70], review: [70, 71] }),
|
|
1163
|
+
open: () => {},
|
|
1164
|
+
openAll: () => {},
|
|
1165
|
+
schedule: (fn) => { fn(); },
|
|
1166
|
+
});
|
|
1167
|
+
await handle.refresh();
|
|
1168
|
+
await settleFrames();
|
|
1169
|
+
|
|
1170
|
+
assert.equal(handle.section.meta({}), '2 issues · 3 pr',
|
|
1171
|
+
'70 is in both buckets and counts once');
|
|
1172
|
+
assert.deepEqual(handle.section.lines({}).map((row) => row.label), ['#2 Issue 2', '#1 Issue 1'],
|
|
1173
|
+
'the pull-request count never changes a row');
|
|
1174
|
+
assert.equal(handle.section.rowLabel, 'github', 'S4 renames the customize row too');
|
|
1175
|
+
});
|
|
1176
|
+
|
|
1177
|
+
// S4: the seam is optional. A caller that names none — every existing wiring —
|
|
1178
|
+
// gets exactly the section it had: the bare issues count and the four click
|
|
1179
|
+
// arguments.
|
|
1180
|
+
test('S4 (T4, re-pinned): without the pull-request seam the header stays `n issues`', async () => {
|
|
1181
|
+
const opened = [];
|
|
1182
|
+
const sched = manualSchedule();
|
|
1183
|
+
const handle = createIssuesSection({
|
|
1184
|
+
load: async () => ({
|
|
1185
|
+
ok: true,
|
|
1186
|
+
identity: IDENTITY,
|
|
1187
|
+
generation: 7,
|
|
1188
|
+
truncated: false,
|
|
1189
|
+
issues: [{ ...issue(4, 'No pull requests at all', '2024-01-01T00:00:00Z'), bucket: 'assigned' }],
|
|
1190
|
+
}),
|
|
1191
|
+
open: (...args) => { opened.push(args); },
|
|
1192
|
+
openAll: () => {},
|
|
1193
|
+
schedule: sched.schedule,
|
|
1194
|
+
});
|
|
1195
|
+
await handle.refresh();
|
|
1196
|
+
assert.equal(handle.section.meta({}), '1 issues', 'no pull-request read, no `pr` segment');
|
|
1197
|
+
|
|
1198
|
+
handle.section.lines({})[0].onClick();
|
|
1199
|
+
await sched.flush();
|
|
1200
|
+
assert.deepEqual(opened, [[4, IDENTITY, 'assigned', 7]],
|
|
1201
|
+
'the row without a linked pull request keeps the call it always made');
|
|
1202
|
+
});
|
|
1203
|
+
|
|
1204
|
+
// S5: the read is never awaited. `lines()`/`meta()` stay synchronous over one
|
|
1205
|
+
// snapshot, so a pull-request read still in flight leaves the header exactly as
|
|
1206
|
+
// it was and the frame still answers.
|
|
1207
|
+
test('S5 (T4): a frame never waits for the pull-request read', async () => {
|
|
1208
|
+
const pending = [];
|
|
1209
|
+
const handle = createIssuesSection({
|
|
1210
|
+
load: readyLoad(issueList(2)),
|
|
1211
|
+
loadPullRequests: () => new Promise((resolve) => pending.push(resolve)),
|
|
1212
|
+
open: () => {},
|
|
1213
|
+
openAll: () => {},
|
|
1214
|
+
schedule: (fn) => { fn(); },
|
|
1215
|
+
});
|
|
1216
|
+
await handle.refresh();
|
|
1217
|
+
await settleFrames();
|
|
1218
|
+
|
|
1219
|
+
assert.equal(handle.section.meta({}), '2 issues', 'a read still in flight adds no segment');
|
|
1220
|
+
assert.deepEqual(handle.section.lines({}).map((row) => row.label), ['#2 Issue 2', '#1 Issue 1'],
|
|
1221
|
+
'and the rows are drawn as usual');
|
|
1222
|
+
|
|
1223
|
+
pending.shift()(railBuckets({ mine: [69] }));
|
|
1224
|
+
await settleFrames();
|
|
1225
|
+
assert.equal(handle.section.meta({}), '2 issues · 1 pr', 'the settled answer paints the count');
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1228
|
+
// S4: a failed pull-request read is a stall, never a lost number: the last count
|
|
1229
|
+
// stays on screen (and so does the issues list's own `· stale`).
|
|
1230
|
+
test('S4 (T4): a failed pull-request read keeps the last count, and `· stale` is kept', async () => {
|
|
1231
|
+
let prReads = 0;
|
|
1232
|
+
const handle = createIssuesSection({
|
|
1233
|
+
load: readyLoad(issueList(2)),
|
|
1234
|
+
loadPullRequests: async () => {
|
|
1235
|
+
prReads += 1;
|
|
1236
|
+
if (prReads === 1) return railBuckets({ mine: [69], review: [70] });
|
|
1237
|
+
return { ok: false, error: 'gh timed out' };
|
|
1238
|
+
},
|
|
1239
|
+
open: () => {},
|
|
1240
|
+
openAll: () => {},
|
|
1241
|
+
// `ttlMs: 0` makes every read stale, so the second refresh re-reads both.
|
|
1242
|
+
ttlMs: 0,
|
|
1243
|
+
schedule: (fn) => { fn(); },
|
|
1244
|
+
});
|
|
1245
|
+
await handle.refresh();
|
|
1246
|
+
await settleFrames();
|
|
1247
|
+
assert.equal(handle.section.meta({}), '2 issues · 2 pr');
|
|
1248
|
+
|
|
1249
|
+
await handle.refresh();
|
|
1250
|
+
await settleFrames();
|
|
1251
|
+
assert.equal(prReads, 2, 'the second refresh asked again');
|
|
1252
|
+
assert.equal(handle.section.meta({}), '2 issues · 2 pr',
|
|
1253
|
+
'a failed pull-request read keeps the count it had instead of blanking the header');
|
|
1254
|
+
|
|
1255
|
+
// And a failing ISSUES read still owns the `· stale` suffix, after the pr count.
|
|
1256
|
+
const failingIssues = createIssuesSection({
|
|
1257
|
+
load: (() => {
|
|
1258
|
+
let reads = 0;
|
|
1259
|
+
return async () => {
|
|
1260
|
+
reads += 1;
|
|
1261
|
+
if (reads === 1) return { ok: true, identity: IDENTITY, issues: issueList(2), truncated: false };
|
|
1262
|
+
return { ok: false, error: 'gh timed out' };
|
|
1263
|
+
};
|
|
1264
|
+
})(),
|
|
1265
|
+
loadPullRequests: railPullRequests({ mine: [69] }),
|
|
1266
|
+
open: () => {},
|
|
1267
|
+
openAll: () => {},
|
|
1268
|
+
ttlMs: 0,
|
|
1269
|
+
schedule: (fn) => { fn(); },
|
|
1270
|
+
});
|
|
1271
|
+
await failingIssues.refresh();
|
|
1272
|
+
await settleFrames();
|
|
1273
|
+
assert.equal(failingIssues.section.meta({}), '2 issues · 1 pr');
|
|
1274
|
+
await failingIssues.refresh();
|
|
1275
|
+
await settleFrames();
|
|
1276
|
+
assert.equal(failingIssues.section.meta({}), '2 issues · 1 pr · stale',
|
|
1277
|
+
'the stalled count keeps both numbers and says it is stale');
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1280
|
+
// S5: the click routing the human asked for. An issue that has a linked pull
|
|
1281
|
+
// request opens the PR panel on THAT pull request, and only when the issue has
|
|
1282
|
+
// none does the row keep the arguments it always passed.
|
|
1283
|
+
test('S5 (T4): a row with a linked pull request opens the PR panel — review beats mine, neither is `all`', async () => {
|
|
1284
|
+
const opened = [];
|
|
1285
|
+
const sched = manualSchedule();
|
|
1286
|
+
const handle = createIssuesSection({
|
|
1287
|
+
load: async () => ({
|
|
1288
|
+
ok: true,
|
|
1289
|
+
identity: IDENTITY,
|
|
1290
|
+
generation: 7,
|
|
1291
|
+
truncated: false,
|
|
1292
|
+
issues: [
|
|
1293
|
+
{ ...issue(63, 'Mine and awaiting review', '2024-04-01T00:00:00Z'), bucket: 'assigned', hasPullRequest: true, pullRequestNumber: 69 },
|
|
1294
|
+
{ ...issue(64, 'Only mine', '2024-03-01T00:00:00Z'), bucket: 'assigned', hasPullRequest: true, pullRequestNumber: 70 },
|
|
1295
|
+
{ ...issue(65, 'Neither bucket', '2024-02-01T00:00:00Z'), bucket: 'assigned', hasPullRequest: true, pullRequestNumber: 71 },
|
|
1296
|
+
{ ...issue(66, 'No pull request', '2024-01-01T00:00:00Z'), bucket: 'assigned', hasPullRequest: false, pullRequestNumber: null },
|
|
1297
|
+
],
|
|
1298
|
+
}),
|
|
1299
|
+
loadPullRequests: railPullRequests({ mine: [69, 70], review: [69] }),
|
|
1300
|
+
open: (...args) => { opened.push(args); },
|
|
1301
|
+
openAll: () => {},
|
|
1302
|
+
schedule: sched.schedule,
|
|
1303
|
+
});
|
|
1304
|
+
await handle.refresh();
|
|
1305
|
+
await sched.flush();
|
|
1306
|
+
|
|
1307
|
+
const rows = handle.section.lines({});
|
|
1308
|
+
assert.equal(rows[0].meta, '\ue726 #69', 'the mark is untouched by the routing');
|
|
1309
|
+
for (const row of rows) row.onClick();
|
|
1310
|
+
await sched.flush();
|
|
1311
|
+
|
|
1312
|
+
assert.deepEqual(opened, [
|
|
1313
|
+
[63, { pullRequest: 69, pullRequestBucket: 'review' }],
|
|
1314
|
+
[64, { pullRequest: 70, pullRequestBucket: 'mine' }],
|
|
1315
|
+
[65, { pullRequest: 71, pullRequestBucket: 'all' }],
|
|
1316
|
+
[66, IDENTITY, 'assigned', 7],
|
|
1317
|
+
], 'a row with no linked pull request keeps the call it always made');
|
|
1318
|
+
});
|
|
1319
|
+
|
|
1320
|
+
// S5: the routing is a fact of the read that is current WHEN THE CLICK RUNS, so
|
|
1321
|
+
// a click on a retained row is answered by the buckets the rail holds now — a
|
|
1322
|
+
// forced read (the caller knows something changed) moves the same row's
|
|
1323
|
+
// destination.
|
|
1324
|
+
test('S5 (T4): a click is routed by the buckets the rail holds when it runs', async () => {
|
|
1325
|
+
const opened = [];
|
|
1326
|
+
let prReads = 0;
|
|
1327
|
+
const sched = manualSchedule();
|
|
1328
|
+
const handle = createIssuesSection({
|
|
1329
|
+
load: async () => ({
|
|
1330
|
+
ok: true,
|
|
1331
|
+
identity: IDENTITY,
|
|
1332
|
+
truncated: false,
|
|
1333
|
+
issues: [{ ...issue(63, 'Linked', '2024-01-01T00:00:00Z'), hasPullRequest: true, pullRequestNumber: 69 }],
|
|
1334
|
+
}),
|
|
1335
|
+
loadPullRequests: async () => {
|
|
1336
|
+
prReads += 1;
|
|
1337
|
+
return prReads === 1 ? railBuckets({ mine: [69] }) : railBuckets({ review: [69] });
|
|
1338
|
+
},
|
|
1339
|
+
open: (...args) => { opened.push(args); },
|
|
1340
|
+
openAll: () => {},
|
|
1341
|
+
schedule: sched.schedule,
|
|
1342
|
+
});
|
|
1343
|
+
await handle.refresh();
|
|
1344
|
+
await sched.flush();
|
|
1345
|
+
|
|
1346
|
+
handle.section.lines({})[0].onClick();
|
|
1347
|
+
await sched.flush();
|
|
1348
|
+
|
|
1349
|
+
await handle.forceRefresh(0);
|
|
1350
|
+
await sched.flush();
|
|
1351
|
+
assert.equal(prReads, 2, 'the forced read asked for the pull requests again');
|
|
1352
|
+
handle.section.lines({})[0].onClick();
|
|
1353
|
+
await sched.flush();
|
|
1354
|
+
|
|
1355
|
+
assert.deepEqual(opened, [
|
|
1356
|
+
[63, { pullRequest: 69, pullRequestBucket: 'mine' }],
|
|
1357
|
+
[63, { pullRequest: 69, pullRequestBucket: 'review' }],
|
|
1358
|
+
], 'the same row routes to `mine` and then to `review` as the buckets move');
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
// S4/S5: the PR count is part of the snapshot a session boundary drops. A read
|
|
1362
|
+
// from the previous session that settles afterwards paints nothing.
|
|
1363
|
+
test('S4/S5 (T4): invalidate() drops the pull-request count, and a late answer lands nowhere', async () => {
|
|
1364
|
+
const pending = [];
|
|
1365
|
+
const handle = createIssuesSection({
|
|
1366
|
+
load: readyLoad(issueList(2)),
|
|
1367
|
+
loadPullRequests: () => new Promise((resolve) => pending.push(resolve)),
|
|
1368
|
+
open: () => {},
|
|
1369
|
+
openAll: () => {},
|
|
1370
|
+
schedule: (fn) => { fn(); },
|
|
1371
|
+
});
|
|
1372
|
+
handle.section.lines({});
|
|
1373
|
+
await settleFrames();
|
|
1374
|
+
assert.equal(pending.length, 1, 'the drawn frame started the pull-request read');
|
|
1375
|
+
|
|
1376
|
+
handle.invalidate();
|
|
1377
|
+
assert.equal(handle.section.meta({}), undefined, 'the loading header claims neither count');
|
|
1378
|
+
|
|
1379
|
+
pending.shift()(railBuckets({ mine: [69] }));
|
|
1380
|
+
await settleFrames();
|
|
1381
|
+
assert.equal(handle.section.meta({}), undefined,
|
|
1382
|
+
'the answer the superseded read delivers lands nowhere');
|
|
1383
|
+
});
|
|
1384
|
+
|
|
1385
|
+
// S4/S5: outside a repository there is nothing to read, so the pull-request read
|
|
1386
|
+
// is not started either — the same settled state the issues read reports.
|
|
1387
|
+
test('S4/S5 (T4): a settled repository state starts no pull-request read at all', async () => {
|
|
1388
|
+
let prReads = 0;
|
|
1389
|
+
const timers = fakeTimerSeam();
|
|
1390
|
+
const handle = createIssuesSection({
|
|
1391
|
+
load: async () => ({ ok: false, error: 'not a git repository', errorTone: 'dim' }),
|
|
1392
|
+
loadPullRequests: async () => {
|
|
1393
|
+
prReads += 1;
|
|
1394
|
+
return railBuckets({ mine: [69] });
|
|
1395
|
+
},
|
|
1396
|
+
open: () => {},
|
|
1397
|
+
openAll: () => {},
|
|
1398
|
+
now: () => timers.clock,
|
|
1399
|
+
setTimer: timers.setTimer,
|
|
1400
|
+
clearTimer: timers.clearTimer,
|
|
1401
|
+
refreshFloorMs: 20000,
|
|
1402
|
+
schedule: (fn) => { fn(); },
|
|
1403
|
+
});
|
|
1404
|
+
await handle.refresh();
|
|
1405
|
+
await settleFrames();
|
|
1406
|
+
handle.section.lines({});
|
|
1407
|
+
handle.section.meta({});
|
|
1408
|
+
await settleFrames();
|
|
1409
|
+
|
|
1410
|
+
assert.equal(prReads, 0, 'a dim state costs no child, so it costs no pull-request read either');
|
|
1411
|
+
assert.equal(timers.armed.length, 0, 'and it keeps no floor timer');
|
|
1412
|
+
assert.equal(handle.section.meta({}), undefined);
|
|
1413
|
+
});
|
|
1414
|
+
|
|
1415
|
+
// S4: the pull-request read obeys the SAME rules the issues read does: the frame
|
|
1416
|
+
// TTL, the self-scheduled floor while the section is drawn, and the drawn window
|
|
1417
|
+
// that stops it.
|
|
1418
|
+
test('S4 (T4): the pull-request read follows the frame TTL, the floor and the drawn window', async () => {
|
|
1419
|
+
const timers = fakeTimerSeam();
|
|
1420
|
+
let issueReads = 0;
|
|
1421
|
+
let prReads = 0;
|
|
1422
|
+
const handle = createIssuesSection({
|
|
1423
|
+
load: async () => {
|
|
1424
|
+
issueReads += 1;
|
|
1425
|
+
return { ok: true, identity: IDENTITY, issues: [], truncated: false };
|
|
1426
|
+
},
|
|
1427
|
+
loadPullRequests: async () => {
|
|
1428
|
+
prReads += 1;
|
|
1429
|
+
return railBuckets({ mine: [69] });
|
|
1430
|
+
},
|
|
1431
|
+
open: () => {},
|
|
1432
|
+
openAll: () => {},
|
|
1433
|
+
schedule: (fn) => { fn(); },
|
|
1434
|
+
now: () => timers.clock,
|
|
1435
|
+
setTimer: timers.setTimer,
|
|
1436
|
+
clearTimer: timers.clearTimer,
|
|
1437
|
+
refreshFloorMs: 20000,
|
|
1438
|
+
timerDrawnWindowMs: 120000,
|
|
1439
|
+
});
|
|
1440
|
+
|
|
1441
|
+
handle.section.lines({});
|
|
1442
|
+
await settleFrames();
|
|
1443
|
+
assert.equal(issueReads, 1);
|
|
1444
|
+
assert.equal(prReads, 1, 'the drawn frame made its own pull-request read');
|
|
1445
|
+
|
|
1446
|
+
handle.section.lines({});
|
|
1447
|
+
handle.section.meta({});
|
|
1448
|
+
await settleFrames();
|
|
1449
|
+
assert.equal(prReads, 1, 'a fresh read is never repeated by a frame');
|
|
1450
|
+
|
|
1451
|
+
timers.take();
|
|
1452
|
+
await settleFrames();
|
|
1453
|
+
assert.equal(prReads, 2, 'the floor reads the pull requests on its own, once per floor');
|
|
1454
|
+
|
|
1455
|
+
// Nobody draws the section for longer than the drawn window: the timer stops
|
|
1456
|
+
// and reads nothing at all.
|
|
1457
|
+
timers.clock += 121000;
|
|
1458
|
+
timers.take();
|
|
1459
|
+
await settleFrames();
|
|
1460
|
+
assert.equal(prReads, 2, 'a section outside its drawn window reads nothing');
|
|
1461
|
+
assert.equal(timers.armed.length, 0, 'and keeps no timer');
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1119
1464
|
// ---------------------------------------------------------------------------
|
|
1120
1465
|
// T2: the bridge wiring in extensions/odd-worktree-tools.ts.
|
|
1121
1466
|
// ---------------------------------------------------------------------------
|
|
@@ -1245,8 +1590,13 @@ function sectionGithub({ issues = [], mine = [], involved = [], counts = {}, rep
|
|
|
1245
1590
|
return { runner, calls };
|
|
1246
1591
|
}
|
|
1247
1592
|
|
|
1593
|
+
// D9 (S4): the rail's pull-request read is a GraphQL request of its own and is
|
|
1594
|
+
// now issued as early as a cold start allows, so it is not one of the ISSUES
|
|
1595
|
+
// reads these assertions order and count. It is told apart by the qualifier only
|
|
1596
|
+
// it carries.
|
|
1248
1597
|
function graphqlCalls(calls) {
|
|
1249
|
-
return calls.filter((call) => call.argv[0] === 'api' && call.argv[1] === 'graphql'
|
|
1598
|
+
return calls.filter((call) => call.argv[0] === 'api' && call.argv[1] === 'graphql'
|
|
1599
|
+
&& !call.argv.join(' ').includes('is:pr'));
|
|
1250
1600
|
}
|
|
1251
1601
|
|
|
1252
1602
|
function sessionStartHandlers(hooks) {
|
|
@@ -1304,6 +1654,15 @@ async function waitForRows(section, ctx) {
|
|
|
1304
1654
|
throw new Error('the section never left loading');
|
|
1305
1655
|
}
|
|
1306
1656
|
|
|
1657
|
+
// D9 (S4): the rail's `· M pr` segment is a SECOND read, and it now lands as
|
|
1658
|
+
// early as a cold start allows (a stored entry paints at once, the live answer
|
|
1659
|
+
// follows). A test about the ISSUES count therefore asserts the part it is
|
|
1660
|
+
// about: the issues number and the `· stale` mark stay exact, and whichever
|
|
1661
|
+
// pull-request count the same header already carries is not what the test reads.
|
|
1662
|
+
function issuesCount(text) {
|
|
1663
|
+
return String(text).replace(/ · \d+ pr/, '');
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1307
1666
|
// S1/S2 (issues-startup-performance T1): the `gh` gate is DISPATCHED startup work
|
|
1308
1667
|
// now, not an awaited step of `session_start`, so it settles a moment after the
|
|
1309
1668
|
// host's handlers return. A test that counts `gh` children waits for that work to
|
|
@@ -1350,8 +1709,13 @@ test('S2: a published bridge receives exactly one section with the decided ident
|
|
|
1350
1709
|
const section = registered[0];
|
|
1351
1710
|
assert.equal(section.id, 'odd-worktree.issues');
|
|
1352
1711
|
assert.equal(section.title, 'GITHUB');
|
|
1353
|
-
|
|
1712
|
+
// S4 (T4, re-pinned): the customize row used to read `issues`; the human asked
|
|
1713
|
+
// for `github`, because the section now carries pull requests beside them.
|
|
1714
|
+
assert.equal(section.rowLabel, 'github');
|
|
1354
1715
|
assert.equal(section.defaultVisible, true);
|
|
1716
|
+
// gentle-shell-bridge 0.13.0: the card is placed at the end of the rail, stated
|
|
1717
|
+
// rather than left to the bridge's default.
|
|
1718
|
+
assert.equal(section.placement, 'end');
|
|
1355
1719
|
assert.equal(typeof section.lines, 'function');
|
|
1356
1720
|
assert.equal(typeof section.meta, 'function');
|
|
1357
1721
|
assert.equal(loaded.commands.has('issues'), true, 'every other surface still registers');
|
|
@@ -1821,7 +2185,7 @@ test('S8 (T9): the ONE combined read supplies both the rows and the pull-request
|
|
|
1821
2185
|
assert.equal(rows[2].meta, '\ue726 #69');
|
|
1822
2186
|
assert.deepEqual(rows.map((row) => row.tone), ['text', 'text', 'text'],
|
|
1823
2187
|
'only the meta column is gray: the row keeps the plain text tone');
|
|
1824
|
-
assert.equal(section.meta(ctx), '3 issues', 'the marker never changes the count');
|
|
2188
|
+
assert.equal(issuesCount(section.meta(ctx)), '3 issues', 'the marker never changes the count');
|
|
1825
2189
|
|
|
1826
2190
|
// T14: the marker read T9 introduced is gone — the same read that returns the
|
|
1827
2191
|
// rows returns their cross-reference facts, so there is no second call.
|
|
@@ -1840,8 +2204,10 @@ test('S8 (T9): the ONE combined read supplies both the rows and the pull-request
|
|
|
1840
2204
|
}
|
|
1841
2205
|
assert.ok(query.includes('timelineItems(last: 10, itemTypes: [CROSS_REFERENCED_EVENT])'),
|
|
1842
2206
|
'the marker selection rides each row and reads the newest events');
|
|
1843
|
-
|
|
1844
|
-
|
|
2207
|
+
// S6/D29: the source carries its REPOSITORY as well, so a same-numbered pull
|
|
2208
|
+
// request in another repository is never the mark this row draws.
|
|
2209
|
+
assert.ok(query.includes('... on PullRequest { number repository { nameWithOwner } }'),
|
|
2210
|
+
'and the selection asks for the number the mark prints and its repository (S8, D29)');
|
|
1845
2211
|
});
|
|
1846
2212
|
|
|
1847
2213
|
// T14 rewrote this test: its old premise — a separate marker read that fails
|
|
@@ -1873,7 +2239,7 @@ test('S4 (T9): a row without a cross-referenced pull request carries no marker a
|
|
|
1873
2239
|
assert.equal('meta' in rows[0], false, 'the decoration is simply absent');
|
|
1874
2240
|
assert.equal(rows[1].meta, '\ue726 #69', 'the row with a pull request carries its number');
|
|
1875
2241
|
const meta = section.meta(ctx);
|
|
1876
|
-
assert.equal(meta, '2 issues', 'the section stays ready, never stale');
|
|
2242
|
+
assert.equal(issuesCount(meta), '2 issues', 'the section stays ready, never stale');
|
|
1877
2243
|
assert.ok(!String(meta).includes('stale'), 'a decoration never reports a stall');
|
|
1878
2244
|
});
|
|
1879
2245
|
|
|
@@ -3527,7 +3893,7 @@ test('S9 (T14): an issue that left the assigned set makes the next refresh a ful
|
|
|
3527
3893
|
() => section.lines(ctx).map((row) => row.label).join('|') === '#12 Twelve',
|
|
3528
3894
|
'the full read never replaced the bucket',
|
|
3529
3895
|
);
|
|
3530
|
-
assert.equal(section.meta(ctx), '1 issues');
|
|
3896
|
+
assert.equal(issuesCount(section.meta(ctx)), '1 issues');
|
|
3531
3897
|
} finally {
|
|
3532
3898
|
Date.now = realNow;
|
|
3533
3899
|
}
|
|
@@ -3577,7 +3943,7 @@ test('S9 (T14): a failed read keeps the cache and the section stale, so the next
|
|
|
3577
3943
|
await fireSessionStart(loaded.hooks, ctx);
|
|
3578
3944
|
const section = registered[0];
|
|
3579
3945
|
await waitForRows(section, ctx);
|
|
3580
|
-
assert.equal(section.meta(ctx), '2 issues');
|
|
3946
|
+
assert.equal(issuesCount(section.meta(ctx)), '2 issues');
|
|
3581
3947
|
|
|
3582
3948
|
offset = 61000;
|
|
3583
3949
|
section.lines(ctx);
|
|
@@ -3946,7 +4312,7 @@ test('S6/S9 (T16): a checkout switch cuts the previous read out of the cache', a
|
|
|
3946
4312
|
);
|
|
3947
4313
|
assert.ok(!section.lines(ctxB).some((row) => row.label === '#11 Left behind'),
|
|
3948
4314
|
"the previous checkout's rows never survive the move");
|
|
3949
|
-
assert.
|
|
4315
|
+
assert.equal(issuesCount(section.meta(ctxB)), '1 issues', 'the header counts only the moved session rows');
|
|
3950
4316
|
});
|
|
3951
4317
|
|
|
3952
4318
|
// T10 (S9): the pre-dispatch proof E18 described is gone, so there is no window
|
|
@@ -4233,3 +4599,246 @@ test('S4 (T3): a save that REJECTS never escapes as an unhandled rejection and n
|
|
|
4233
4599
|
store.createIssuesCacheStore = originalFactory;
|
|
4234
4600
|
}
|
|
4235
4601
|
});
|
|
4602
|
+
|
|
4603
|
+
// ---------------------------------------------------------------------------
|
|
4604
|
+
// T8b (S4): the header's `pr` count is EXACT, and a cold start paints it from
|
|
4605
|
+
// the disk at once.
|
|
4606
|
+
//
|
|
4607
|
+
// D8: the rail's read reports an exact `issueCount` per bucket while carrying at
|
|
4608
|
+
// most a window of rows. The count is the distinct numbers in mine ∪ review PLUS
|
|
4609
|
+
// the remainder of each bucket's total — the numbers the answer never carried,
|
|
4610
|
+
// which cannot be deduplicated against anything and so are counted one by one.
|
|
4611
|
+
// It is never less than what is known: a total below the rows it came with, a
|
|
4612
|
+
// hostile total, or no total at all leaves the distinct count alone.
|
|
4613
|
+
//
|
|
4614
|
+
// D9: `hydratePullRequests` is the stored entry's own seam. The section asks it
|
|
4615
|
+
// only from a read it already dispatched (never from a frame, never from a
|
|
4616
|
+
// session path), paints it only while no read has painted a count yet, and the
|
|
4617
|
+
// live answer always replaces it. The stored entry never settles the read: the
|
|
4618
|
+
// live read is asked every time its own TTL says so, and a settled state — no
|
|
4619
|
+
// repository proof — reads no entry at all.
|
|
4620
|
+
// ---------------------------------------------------------------------------
|
|
4621
|
+
|
|
4622
|
+
// `total` is the bucket's exact `issueCount`, which the window of `rows` may
|
|
4623
|
+
// under-represent.
|
|
4624
|
+
function countedBuckets(buckets, totals) {
|
|
4625
|
+
return async () => ({
|
|
4626
|
+
ok: true,
|
|
4627
|
+
mine: (buckets.mine || []).map((number) => ({ number, linkedIssues: [] })),
|
|
4628
|
+
review: (buckets.review || []).map((number) => ({ number, linkedIssues: [] })),
|
|
4629
|
+
counts: totals,
|
|
4630
|
+
});
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
test('S4 (T8b, D8): the pr count adds each bucket\'s unfetched remainder', async () => {
|
|
4634
|
+
const numbers = Array.from({ length: 50 }, (_, index) => index + 1);
|
|
4635
|
+
const handle = createIssuesSection({
|
|
4636
|
+
load: readyLoad(issueList(2)),
|
|
4637
|
+
// The verifier's own case: `issueCount=51` with 50 nodes and an empty
|
|
4638
|
+
// review painted `2 issues · 50 pr`, dropping the one row the window cut.
|
|
4639
|
+
loadPullRequests: countedBuckets({ mine: numbers, review: [] }, { mine: 51, review: 0 }),
|
|
4640
|
+
open: () => {},
|
|
4641
|
+
openAll: () => {},
|
|
4642
|
+
schedule: (fn) => { fn(); },
|
|
4643
|
+
});
|
|
4644
|
+
await handle.refresh();
|
|
4645
|
+
await settleFrames();
|
|
4646
|
+
|
|
4647
|
+
assert.equal(handle.section.meta({}), '2 issues · 51 pr',
|
|
4648
|
+
'the unfetched remainder of a bucket counts too, so the header is never short');
|
|
4649
|
+
});
|
|
4650
|
+
|
|
4651
|
+
test('S4 (T8b, D8): remainders are added per bucket, and no total can lower the count', async () => {
|
|
4652
|
+
const mine = Array.from({ length: 50 }, (_, index) => index + 1);
|
|
4653
|
+
const overlapping = createIssuesSection({
|
|
4654
|
+
load: readyLoad(issueList(2)),
|
|
4655
|
+
// Two buckets, both cut: 50 fetched (1..50) + 69 = 51 distinct numbers, plus
|
|
4656
|
+
// one remainder each — 69 shared with nothing, since a remainder's number was
|
|
4657
|
+
// never carried.
|
|
4658
|
+
loadPullRequests: countedBuckets({ mine, review: [50, 69] }, { mine: 51, review: 3 }),
|
|
4659
|
+
open: () => {},
|
|
4660
|
+
openAll: () => {},
|
|
4661
|
+
schedule: (fn) => { fn(); },
|
|
4662
|
+
});
|
|
4663
|
+
await overlapping.refresh();
|
|
4664
|
+
await settleFrames();
|
|
4665
|
+
assert.equal(overlapping.section.meta({}), '2 issues · 53 pr',
|
|
4666
|
+
'each bucket\'s remainder counts, and the fetched numbers still dedupe');
|
|
4667
|
+
|
|
4668
|
+
const hostile = createIssuesSection({
|
|
4669
|
+
load: readyLoad(issueList(2)),
|
|
4670
|
+
// A total BELOW the rows it came with, and a total that is not a count at
|
|
4671
|
+
// all: neither is trusted, and neither can shrink what the rows prove.
|
|
4672
|
+
loadPullRequests: countedBuckets({ mine, review: [69] }, { mine: 3, review: 'many' }),
|
|
4673
|
+
open: () => {},
|
|
4674
|
+
openAll: () => {},
|
|
4675
|
+
schedule: (fn) => { fn(); },
|
|
4676
|
+
});
|
|
4677
|
+
await hostile.refresh();
|
|
4678
|
+
await settleFrames();
|
|
4679
|
+
assert.equal(hostile.section.meta({}), '2 issues · 51 pr',
|
|
4680
|
+
'the distinct numbers stay the floor, whatever a total claims');
|
|
4681
|
+
});
|
|
4682
|
+
|
|
4683
|
+
test('S4 (T8b, D9): a cold start paints the stored count while the live read is held, and the live answer replaces it', async () => {
|
|
4684
|
+
const pending = [];
|
|
4685
|
+
const hydrated = [];
|
|
4686
|
+
const handle = createIssuesSection({
|
|
4687
|
+
load: readyLoad(issueList(2)),
|
|
4688
|
+
hydratePullRequests: async (identity) => {
|
|
4689
|
+
hydrated.push(identity);
|
|
4690
|
+
return { mine: [{ number: 69, linkedIssues: [1] }], review: [], syncedAt: 1 };
|
|
4691
|
+
},
|
|
4692
|
+
loadPullRequests: () => new Promise((resolve) => pending.push(resolve)),
|
|
4693
|
+
open: () => {},
|
|
4694
|
+
openAll: () => {},
|
|
4695
|
+
schedule: (fn) => { fn(); },
|
|
4696
|
+
});
|
|
4697
|
+
await handle.refresh();
|
|
4698
|
+
await settleFrames();
|
|
4699
|
+
|
|
4700
|
+
assert.deepEqual(hydrated, [IDENTITY], 'the entry is asked for the identity the issues read proved');
|
|
4701
|
+
assert.equal(handle.section.meta({}), '2 issues · 1 pr',
|
|
4702
|
+
'the stored count paints at once, before the live read answers');
|
|
4703
|
+
|
|
4704
|
+
pending.shift()(railBuckets({ mine: [69, 70] }));
|
|
4705
|
+
await settleFrames();
|
|
4706
|
+
assert.equal(handle.section.meta({}), '2 issues · 2 pr', 'the live answer replaces the stored one');
|
|
4707
|
+
});
|
|
4708
|
+
|
|
4709
|
+
test('S4 (T8b, D9): the stored entry never settles the read, and a failed live read keeps its count', async () => {
|
|
4710
|
+
const pending = [];
|
|
4711
|
+
let hydrations = 0;
|
|
4712
|
+
let liveReads = 0;
|
|
4713
|
+
let failNext = false;
|
|
4714
|
+
const handle = createIssuesSection({
|
|
4715
|
+
load: readyLoad(issueList(2)),
|
|
4716
|
+
hydratePullRequests: async () => {
|
|
4717
|
+
hydrations += 1;
|
|
4718
|
+
return { mine: [{ number: 69, linkedIssues: [] }], review: [], syncedAt: 1 };
|
|
4719
|
+
},
|
|
4720
|
+
loadPullRequests: () => {
|
|
4721
|
+
liveReads += 1;
|
|
4722
|
+
if (failNext) return { ok: false, error: 'gh timed out' };
|
|
4723
|
+
return new Promise((resolve) => pending.push(resolve));
|
|
4724
|
+
},
|
|
4725
|
+
open: () => {},
|
|
4726
|
+
openAll: () => {},
|
|
4727
|
+
// `ttlMs: 0` makes every attempt stale, so the second refresh asks again.
|
|
4728
|
+
ttlMs: 0,
|
|
4729
|
+
schedule: (fn) => { fn(); },
|
|
4730
|
+
});
|
|
4731
|
+
await handle.refresh();
|
|
4732
|
+
await settleFrames();
|
|
4733
|
+
assert.equal(liveReads, 1, 'a stored entry does not defeat the live read: it was asked anyway');
|
|
4734
|
+
assert.equal(handle.section.meta({}), '2 issues · 1 pr');
|
|
4735
|
+
pending.shift()(railBuckets({ mine: [69, 70] }));
|
|
4736
|
+
await settleFrames();
|
|
4737
|
+
assert.equal(handle.section.meta({}), '2 issues · 2 pr');
|
|
4738
|
+
|
|
4739
|
+
failNext = true;
|
|
4740
|
+
await handle.refresh();
|
|
4741
|
+
await settleFrames();
|
|
4742
|
+
assert.equal(liveReads, 2, 'the next attempt asks the live read again, stored entry or not');
|
|
4743
|
+
assert.equal(hydrations, 1, 'nothing is hydrated over a count that is already painted');
|
|
4744
|
+
assert.equal(handle.section.meta({}), '2 issues · 2 pr', 'a failed read keeps the count it had');
|
|
4745
|
+
});
|
|
4746
|
+
|
|
4747
|
+
test('S4 (T8b, D9): a settled state reads no stored entry at all', async () => {
|
|
4748
|
+
let hydrations = 0;
|
|
4749
|
+
let liveReads = 0;
|
|
4750
|
+
const handle = createIssuesSection({
|
|
4751
|
+
load: async () => ({ ok: false, error: 'not a git repository', errorTone: 'dim' }),
|
|
4752
|
+
hydratePullRequests: async () => {
|
|
4753
|
+
hydrations += 1;
|
|
4754
|
+
return { mine: [{ number: 69, linkedIssues: [] }], review: [], syncedAt: 1 };
|
|
4755
|
+
},
|
|
4756
|
+
loadPullRequests: async () => {
|
|
4757
|
+
liveReads += 1;
|
|
4758
|
+
return railBuckets({ mine: [69] });
|
|
4759
|
+
},
|
|
4760
|
+
open: () => {},
|
|
4761
|
+
openAll: () => {},
|
|
4762
|
+
schedule: (fn) => { fn(); },
|
|
4763
|
+
});
|
|
4764
|
+
await handle.refresh();
|
|
4765
|
+
await settleFrames();
|
|
4766
|
+
|
|
4767
|
+
assert.deepEqual(handle.section.lines({}), [{ label: 'not a git repository', tone: 'dim' }]);
|
|
4768
|
+
assert.equal(hydrations, 0, 'a settled state hydrates nothing from the disk');
|
|
4769
|
+
assert.equal(liveReads, 0, 'and reads no pull requests');
|
|
4770
|
+
assert.equal(handle.section.meta({}), undefined, 'nor paints a count it was never given');
|
|
4771
|
+
});
|
|
4772
|
+
|
|
4773
|
+
// ---------------------------------------------------------------------------
|
|
4774
|
+
// T10b (S4): D9 — both settlements of the pull-request read repaint the header.
|
|
4775
|
+
//
|
|
4776
|
+
// The issues read already asks the section's own notifier for a repaint when it
|
|
4777
|
+
// lands (`replace()` reads `onRefreshed`). The `pr` count is painted from a
|
|
4778
|
+
// SECOND state, so its two settlements — the stored entry from the disk and the
|
|
4779
|
+
// live answer — must ask for the same repaint, or the header keeps its old count
|
|
4780
|
+
// until some unrelated event produces a frame. A frame asks for none: the
|
|
4781
|
+
// notifier is reached from a landed read alone (invariants 24-28 keep every
|
|
4782
|
+
// session path and every frame free of the read), and a disposed or superseded
|
|
4783
|
+
// section still repaints nothing.
|
|
4784
|
+
// ---------------------------------------------------------------------------
|
|
4785
|
+
|
|
4786
|
+
test('S4 (T10b, D9): the live pull-request settlement asks for one repaint, and a frame asks for none', async () => {
|
|
4787
|
+
const pending = [];
|
|
4788
|
+
let repaints = 0;
|
|
4789
|
+
const handle = createIssuesSection({
|
|
4790
|
+
load: readyLoad(issueList(2)),
|
|
4791
|
+
loadPullRequests: () => new Promise((resolve) => pending.push(resolve)),
|
|
4792
|
+
open: () => {},
|
|
4793
|
+
openAll: () => {},
|
|
4794
|
+
onRefreshed: () => { repaints += 1; },
|
|
4795
|
+
schedule: (fn) => { fn(); },
|
|
4796
|
+
});
|
|
4797
|
+
await handle.refresh();
|
|
4798
|
+
await settleFrames();
|
|
4799
|
+
assert.equal(handle.section.meta({}), '2 issues', 'the issues read painted its own header, with no `pr` count yet');
|
|
4800
|
+
const painted = repaints;
|
|
4801
|
+
|
|
4802
|
+
// The two drawing calls are frames over the in-process snapshot: neither is a
|
|
4803
|
+
// reason to repaint anything.
|
|
4804
|
+
handle.section.lines({});
|
|
4805
|
+
handle.section.meta({});
|
|
4806
|
+
await settleFrames();
|
|
4807
|
+
assert.equal(repaints, painted, 'a frame never asks for a repaint');
|
|
4808
|
+
|
|
4809
|
+
pending.shift()(railBuckets({ mine: [69] }));
|
|
4810
|
+
await settleFrames();
|
|
4811
|
+
assert.equal(repaints, painted + 1, 'the settled pull-request read repaints the header it changed');
|
|
4812
|
+
assert.equal(handle.section.meta({}), '2 issues · 1 pr', 'and the repaint is what the new count is painted by');
|
|
4813
|
+
});
|
|
4814
|
+
|
|
4815
|
+
test('S4 (T10b, D9): the hydration asks for one repaint when the stored count paints', async () => {
|
|
4816
|
+
let settleStored = null;
|
|
4817
|
+
let repaints = 0;
|
|
4818
|
+
const handle = createIssuesSection({
|
|
4819
|
+
load: readyLoad(issueList(2)),
|
|
4820
|
+
hydratePullRequests: () => new Promise((resolve) => { settleStored = resolve; }),
|
|
4821
|
+
loadPullRequests: () => new Promise(() => {}),
|
|
4822
|
+
open: () => {},
|
|
4823
|
+
openAll: () => {},
|
|
4824
|
+
onRefreshed: () => { repaints += 1; },
|
|
4825
|
+
schedule: (fn) => { fn(); },
|
|
4826
|
+
});
|
|
4827
|
+
await handle.refresh();
|
|
4828
|
+
await settleFrames();
|
|
4829
|
+
assert.equal(typeof settleStored, 'function', 'the dispatched read asked the disk for the stored entry');
|
|
4830
|
+
assert.equal(handle.section.meta({}), '2 issues', 'nothing was painted from the disk yet');
|
|
4831
|
+
const painted = repaints;
|
|
4832
|
+
|
|
4833
|
+
settleStored({ mine: [{ number: 69, linkedIssues: [] }], review: [], syncedAt: 1 });
|
|
4834
|
+
await settleFrames();
|
|
4835
|
+
assert.equal(repaints, painted + 1, 'the hydration repaints the header it just painted from the disk');
|
|
4836
|
+
assert.equal(handle.section.meta({}), '2 issues · 1 pr');
|
|
4837
|
+
|
|
4838
|
+
// A state that keeps its count (`stale`) repaints nothing on top of a refusal
|
|
4839
|
+
// that has nothing to paint: the settled section is not a reason to paint.
|
|
4840
|
+
handle.dispose();
|
|
4841
|
+
const afterDispose = repaints;
|
|
4842
|
+
await settleFrames();
|
|
4843
|
+
assert.equal(repaints, afterDispose, 'a disposed section repaints nothing');
|
|
4844
|
+
});
|