Repository navigation
Conversation
…e API answers with 202 is a success, not a red error The API saves the change and answers 202 while it still indexes the repository's content for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…he notices again 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 47cbf6c) 1 finding: P2 1.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "full",
"commit": "47cbf6ced0f91e4aa83ccee27949b9f46e4905b4",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P2",
"tag": null,
"file": "src/components/repos/RepoCreate.jsx",
"line": 290,
"claim": "A successful 202 can skip the account notice refresh when the edit form has a stale copy of the source.",
"scenario": "Open a populated public source in two tabs. Make it private in the first tab. In the stale tab, edit the description and save. The form resubmits Public, so the API switches the source back to public and returns 202. The response matches the stale tab's original visibility, so the form reports success and navigates without re-requesting account notices.",
"action": "Refresh notices on every successful 202 and cover the case where the returned visibility matches the form's original value.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answer to pass 1, in the second commit:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
|
Simplification review (claude subagent, commit 6b1e2fc) 2 possible cuts.
findings.json{
"reviewer": "claude subagent",
"perspective": "simplify",
"mode": "full",
"commit": "6b1e2fc0fd31c57f0ceb40d707761bacbd235c24",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "S1",
"severity": null,
"tag": "dup-test",
"file": "src/components/repos/__tests__/repoSave.test.js",
"line": 19,
"claim": "The refusal test asserts five near-identical inputs (detail body, field-error body, string, undefined). Two cases cover the same branch (no numeric status, so false): the API error body and the string/undefined case.",
"scenario": null,
"action": "Keep one API-body case and one non-object case (e.g. 'Network Error'); drop the field-error body and the undefined case.",
"lines_delta": -2,
"confidence": "low"
},
{
"id": "S2",
"severity": null,
"tag": "shrink",
"file": "src/components/repos/repoSave.js",
"line": 2,
"claim": "The comment says the same thing as the 202 test name and the line's own status list. The exported one-line helper has a single caller; it exists only so node --test can reach it, which the ticket's test criterion requires, so keep the function and trim the comment to one short line or fold the 202 reason into the test only.",
"scenario": null,
"action": "Shorten the comment, or drop it and let the test name carry the reason.",
"lines_delta": -1,
"confidence": "low"
}
]
}Answers:
|
|
Codex check of commits 47cbf6c..4f1b925 (codex-cli 0.171.0) Clean: no findings. findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "final",
"commit": "4f1b925a1bf349a68103c8df06b552173f299a18",
"verdict": "clean",
"prior": [
{
"id": "F1.1",
"status": "resolved"
}
],
"findings": []
} |
snyaggarwal
left a comment
There was a problem hiding this comment.
Approve. A save that the API answers with 202 is now treated as a success, like 200 and 201. The form says the repository was updated and goes to it, instead of showing "202: [object Object]".
Merge order: any time. It doesn't depend on an API change. CI (lint and test) passes on 4f1b925, and it merges cleanly.
What I checked against oclapi2:
- The 202 answer.
ConceptContainerBaseView.update(core/common/mixins.py) answers 202 only when the save started the reindex of a visibility change (_public_access_task, set incore/sources/signals.py). Its body is the same detail serializer as the 200, soresponse.data.urlis there for the redirect. - Refusals. APIService gives back the error body or message with no
status, soisRepoSavedis false for refusals, and the refusal-notice and error branches work as before. - Other forms.
RepoCreate.jsxis the only oclweb3 form that writespublic_access. The versions tab already treats 202 fromsummary/separately. So I agree no other form needs the change. - Asking for the notices on every save (your answer to F1.1). It's one extra GET per save, it covers a stale form, and it's simpler than comparing values.
|
Correction to my review: the 202 comes from |
Closes OpenConceptLab/ocl_online#885
When an owner made a source private, or public again, the form showed a red "202: [object Object]" and stayed open, although the change was saved. The API answers 202 when it saved the change and is still indexing the source's concepts and mappings for it. The form took only 200 and 201 as success.
Now 202 is a success too, so the form does what it does after any other update: it says that the repository was updated, goes to it, and asks for the notices again. The answer has the same repository data as a 200.
Every save asks for the notices again now, not only one that changed the visibility from what the form was filled with. A form opened before someone changed it elsewhere can change it back without looking like a change.
Other forms: none needs it. This is the only form that changes a repository's visibility, and that change is the only save that the API answers with 202. (For a collection it answers 200.)
Checked
To check on staging: make a source with a concept in it private, then public again. Each time the form says "updated" and goes to the source.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN