Repository navigation
OpenConceptLab/ocl_online#884 | A collection's expansions page shows the health result by itself, and says Default only for the default - #129
Conversation
…the health result by itself, and says Default only for the default While a version's health is being checked, the open page reads its expansions again every 30 seconds, as for a build, until there's a result, the page is left or ten minutes have passed. The open details window shows the result too. With the marks off, nothing asks for health. A version with expansions and no default says "Default: None". It named its first expansion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…n, and each health check has its own ten minutes A default that was cleared in the version's form stayed marked in the list, and one set in the list hid a later edit. A version that is busy with an export and has no default says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
|
Codex review, pass 1 (codex-cli 0.171.0, commit 081a9fe) 4 findings: P1 1, P2 3.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "full",
"commit": "081a9fe41670176704627b9319e8b61d82094748",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/repos/ExpansionRowListWithoutMarks.jsx",
"line": 148,
"claim": "With marks off, clearing the default can leave the old expansion labeled Default and hide Set as default for it.",
"scenario": "Open Versions + Expansions with marks off, let the expansion list load, then clear a named version's expansion in Edit. The refreshed version has a null expansion_url, so the version row says Default: None. Its cached expansion still has default: true because the marks-off refresh skips the cached list. The expansion row still says Default and its menu omits Set as default.",
"action": "Derive the expansion row's badge and menu eligibility from the latest version's expansion_url, including with marks off.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.2",
"severity": "P2",
"tag": null,
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 538,
"claim": "A change to another version's pending status resets the ten-minute polling limit for every pending expansion.",
"scenario": "Expansion A's check gets lost. At minute nine, a check for expansion B starts or finishes. The pending URL list changes, which gives A a fresh ten-minute timer even though its pending status has stayed the same.",
"action": "Track the polling deadline per default expansion and preserve it when other expansions enter or leave the pending set.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.3",
"severity": "P2",
"tag": null,
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 535,
"claim": "Polling repeats the first page of expansions even when the default is on a later page.",
"scenario": "A version has more than 25 expansions and its default is outside the first API page. The version summary contains a prior healthy result with is_current: false, so the row says Checking health. Every poll rereads the same first page and leaves that summary stale. The row still says Checking health after the server has finished the check and the timer has expired.",
"action": "When the expansion list omits the default, poll its expansion_url or refresh the version summary used by the row.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.4",
"severity": "P2",
"tag": null,
"file": "src/components/repos/defaultExpansion.js",
"line": 9,
"claim": "A background job can make a version with expansions and no default say Default: Auto-expand.",
"scenario": "An autoexpand-enabled version has existing expansions and a cleared default. While an export is running, the API reports is_processing: true. The label implies an automatic default is coming even though the export does not assign one.",
"action": "Return None when expansions are present and expansion_url is empty. Update the test that expects Auto-expand for that state.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answers to pass 1, in the second commit:
|
…the version, so its next read replaces it HEAD's was kept over every later read. And a version that has expansions and no default says None while one of them is rebuilt, also when it was made with autoexpand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
|
Codex review, pass 2 (codex-cli 0.171.0, commit d9b639e) 3 findings: P1 1, P2 2.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "verify",
"commit": "d9b639ed56785ea381a1bdebb17b39ddddf1ac78",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "unresolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "unresolved"
},
{
"id": "F1.4",
"status": "regressed"
}
],
"findings": [
{
"id": "F2.1",
"severity": "P1",
"tag": null,
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 285,
"claim": "A local HEAD override can keep the wrong expansion marked as Default after the tab reads fresh HEAD data.",
"scenario": "Set HEAD's default to A in one tab, then set it to B in another. In the first tab, create a third expansion to trigger a refresh. The HEAD response names B, but the retained override still marks A as Default and offers Set as default on B.",
"action": "Retire the HEAD override when a HEAD read started after the successful write returns.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.2",
"severity": "P2",
"tag": null,
"file": "src/components/repos/defaultExpansion.js",
"line": 9,
"claim": "Rebuilding an existing nondefault expansion can make a version with no default display Auto-expand.",
"scenario": "Clear the default on a version created with Auto-expand, then open the tab while an existing expansion is being rebuilt. The API returns a null expansion_url and is_processing true for the rebuild. The row says Default: Auto-expand even though the rebuild leaves the default unset.",
"action": "Show None when the loaded list contains expansions and the version has no default. Keep the Auto-expand placeholder for initial creation.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.3",
"severity": "P2",
"tag": null,
"file": "src/components/repos/expansionHealth.js",
"line": 43,
"claim": "The polling limit counts timer callbacks, so delayed callbacks can send requests past the ten-minute deadline.",
"scenario": "Leave a tab open with a lost check still pending, then put the laptop to sleep after the first poll. On wake 30 minutes later, the timer can resume sending health requests even though the ten-minute window has elapsed.",
"action": "Record a deadline when polling starts and check it before sending each request.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answers to pass 2, in the third commit:
|
|
Simplification review (claude subagent, commit 8e7ba3e) 3 possible cuts.
findings.json{
"reviewer": "claude subagent",
"perspective": "simplify",
"mode": "full",
"commit": "8e7ba3e381e416e0063eeb6848ac0903a31a6166",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "S1",
"severity": null,
"tag": "shrink",
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 531,
"claim": "readHealthRef, plus the lookup by URL through find(checkingHealthVersions, {expansion_url: url}) on every tick, exists only so a long-lived interval can see current state. Each poll is already keyed by the version's expansion_url, so the ref could hold the current checkingHealthVersions array directly, and the poll callback could call fetchExpansions on the version found in it. The wrapper closure and the ref assignment during render collapse into one ref.",
"scenario": null,
"action": "Keep a single ref (for example checkingVersionsRef.current = checkingHealthVersions) and have the poll callback do the find and fetch inline, so the extra readHealthRef.current = url => {...} indirection goes.",
"lines_delta": -3,
"confidence": "low"
},
{
"id": "S2",
"severity": null,
"tag": "shrink",
"file": "src/components/repos/defaultExpansion.js",
"line": 2,
"claim": "findDefaultExpansion repeats its guard: `version?.expansion_url && expansions?.find(...)` followed by `|| null`. Find returns undefined, and the callers only compare the result to null or read .mnemonic from it.",
"scenario": null,
"action": "Return `expansions?.find(expansion => expansion.url === version?.expansion_url && version.expansion_url)`, or drop the `|| null` and compare with `== null`. The tests assert `null` via assert.equal, so they would need loosening or a kept `?? null`.",
"lines_delta": -1,
"confidence": "low"
},
{
"id": "S3",
"severity": null,
"tag": "dup-test",
"file": "src/components/repos/__tests__/defaultExpansion.test.js",
"line": 27,
"claim": "The test 'the default is named by its URL until the expansions have loaded' and the two Auto-expand cases in 'a version that will get its expansion says so' largely restate branch checks already covered by the first two tests. The `undefined` and `[]` variants of NONE repeat the same branch as the empty-list case.",
"scenario": null,
"action": "Merge the last three tests into one table-driven test, or drop the `label(NONE, undefined)` and `label(version, undefined)` repeats. The branches stay covered.",
"lines_delta": -5,
"confidence": "low"
}
]
}Answers:
|
|
Codex review, pass 3 (codex-cli 0.171.0, commit 8e7ba3e) 2 findings: P2 2.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "verify",
"commit": "8e7ba3e381e416e0063eeb6848ac0903a31a6166",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "resolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "unresolved"
},
{
"id": "F1.4",
"status": "resolved"
},
{
"id": "F2.1",
"status": "resolved"
},
{
"id": "F2.2",
"status": "resolved"
},
{
"id": "F2.3",
"status": "unresolved"
}
],
"findings": [
{
"id": "F3.1",
"severity": "P2",
"tag": null,
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 319,
"claim": "A failed duplicate refresh can discard the successful response that contains a newly created expansion.",
"scenario": "With marks enabled, create a non-default expansion for a version whose expansion list is already loaded. Creation starts an expansions GET, and the versions refresh starts a second GET before the first finishes. If the second GET fails, the request counter discards the first GET's successful response. The new expansion stays missing until another refresh.",
"action": "Coalesce expansion refreshes triggered by the same edit. Preserve request ordering across edits so a response captured before a write cannot replace post-write data.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.2",
"severity": "P2",
"tag": null,
"file": "src/components/repos/CollectionVersionsTab.jsx",
"line": 559,
"claim": "An older versions response can restore the previous default after Set as default succeeds.",
"scenario": "Set expansion B as the default, then change the table's page size while the PUT is pending. If the page-size request reads the previous default A before the write commits and arrives after the post-write refresh, it replaces the version containing B. The tab marks A as Default until another version refresh.",
"action": "Track versions request order and invalidate reads started before a successful default change.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answers to pass 3, the last one. No P0 or P1 is open, and nothing was committed after it.
|
snyaggarwal
left a comment
There was a problem hiding this comment.
Ready to merge once #122 is in. I'm posting this as a comment rather than an approval only because it's stacked on #122's branch. Merge order: OpenConceptLab/oclapi2#1115, then #122, then this PR moved to main, as the PR body says. If #122 is squash-merged, rebase this PR onto main (git rebase --onto main 0e080ebf2) before merging, so #122's original commits don't come along. I found nothing blocking in the code. CI is green.
It's behind EXPANSION_MARKS_TOGGLE where it needs to be.
- The health polling is a mark and is gated:
checkingHealthVersionsis[]whenshowMarksis off, so no poll starts and nothing asks for health. The details window follows the list and only shows health throughExpansionHealthSection, which #122 already gates. - The "Default" label is a bug fix in both modes, not a mark, so it's right that it isn't gated. In
ExpansionRowListWithoutMarks,expansion.default || expansion.autobecomesexpansion.default. That now matchesExpansionRowList, which never read.auto. It means the marks-off view no longer matches 3.0.59 pixel for pixel for that one badge, as the PR body says.
It fits on #122 without conflicts. It's based on #122's current head (0e080ebf2), and #122 hasn't changed since.
versionOverridesis gone. Set as default now writesexpansion_urlintoversionsandheadVersion, andexpansionsByVersionis derived fromloadedExpansionsand the versions. The label, the list and the health all follow the latest version read. I checked that the derived value can't loop:displayVersionsis memoized inuseProcessingVersions, and the auto-expand effect returnsprevwhen nothing changed.- Matching the health expansion by
findDefaultExpansion(the version'sexpansion_urlonly) agrees withgetVersionHealthStatus, which was already strict. - The leftover "first expansion" fallback in
getDefaultExpansion(for counts, the warning icon and release updates) is left as it is on purpose, as the PR body says.
The Codex findings and simplification items are already answered on the PR. I'm not raising F1.3 (more than 25 expansions), F2.3 (a laptop waking up), F3.1 or F3.2 again.
Closes OpenConceptLab/ocl_online#884
This goes onto #122's branch, because both change
CollectionVersionsTab.jsx. It moves tomainwhen #122 is in.1. The open page shows the health result by itself. It used to say "Checking health" until the owner left the tab and came back.
EXPANSION_MARKS_TOGGLEoff, nothing asks for health.2. The list says "Default" only for the version's own default expansion.
Left as it is, on purpose: a version with no default still takes its counts, warning icon and release updates from its first expansion.
Nothing new is drawn.
How it was checked
npm test(370 tests) and eslint pass. New tests cover the label, when a version counts as being checked, and when the reading stops.To check on staging: make a version's expansion, or set another one as default, and leave the page open. "Checking health" turns into the result by itself, within about two minutes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN