Repository navigation
Conversation
… page load and return While a person has account notices, they're asked for again at each page load and each return to the page, so a notice goes once what it's about has changed, even in another tab or site. With none, at most once an hour. A failed request changes nothing that's shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
…hange is announced Otherwise, with none stored and the request after the change failing, the next page load wouldn't ask for up to an hour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
…ed request, and an answer is only for who asked A change that's announced drops a stored "none" only. An answer that arrives once another tab has signed in as someone else is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
…slation is asked for What's shown is kept with whose it is, so another person's never shows, and a change of language doesn't clear it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
…ated another goes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
|
Codex review, pass 1 (codex-cli 0.169.0, commit c252064) Verdict: findings, 2 findings.
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "full",
"commit": "c25206465",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 83,
"claim": "A failed refresh after a known change leaves the old empty answer eligible to suppress retries.",
"scenario": "An account cached an empty answer 10 minutes ago. A successful write triggers a notice refresh, but the request times out. The API recovers and now has a notice. Reloading or returning to the tab skips the request for the remaining 50 minutes, so the notice stays missing.",
"action": "Invalidate the matching empty cache entry when a change event triggers a refresh. Keep the displayed notices as they are until a successful response arrives.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.2",
"severity": "P2",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 101,
"claim": "A return-triggered request can use one account's credentials and cache its notices under another account's username.",
"scenario": "An OAuth callback starts with account A's profile still in local storage. The callback installs account B's token before B's profile finishes loading. If the user returns to the tab during that gap, the listener uses A's captured username while APIService sends B's token. If the notices request finishes first, B's notices appear and are cached under A.",
"action": "Tie notice requests and displayed state to the authenticated session. Wait for the profile associated with the current token, and verify that the session is still current before accepting a response.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Pass 1, both findings answered (commit 197a9c3):
|
|
Codex review, pass 2 (codex-cli 0.169.0, commit 197a9c3) Verdict: findings, 2 findings. Earlier: F1.1 regressed, F1.2 unresolved
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "verify",
"commit": "197a9c3df",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "regressed"
},
{
"id": "F1.2",
"status": "unresolved"
}
],
"findings": [
{
"id": "F2.1",
"severity": "P2",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 107,
"claim": "The fix restores retries for empty answers but also discards cached notices needed on reload.",
"scenario": "An account has a visible notice. A write triggers a refresh, and the notices endpoint returns 503. The notice stays visible until the person reloads. If the endpoint is still failing, the strip disappears because the change event deleted the last successful answer.",
"action": "Invalidate only the matching empty cache entry. Keep cached notices available on reload until a successful refresh replaces them.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.2",
"severity": "P2",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 102,
"claim": "The account mismatch can happen after sign-in has finished in another tab.",
"scenario": "Tab 1 is open under A and shows a notice. Tab 2 signs in as B over the existing session and finishes loading B's profile. Tab 1 ignores the token replacement, so returning to it runs the listener captured for A with B's token and caches B's notices under A. If the next request fails, A can see B's notices on signing in again in tab 1.",
"action": "Update the hook when the authenticated account changes across tabs. Bind requests, cache writes, and displayed notices to the same authenticated session, and discard responses after that session changes.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Pass 2, both findings fixed (commit 0428d94):
|
|
Codex review, pass 3 (codex-cli 0.169.0, commit 0428d94) Verdict: findings, 3 findings. Earlier: F1.1 resolved, F1.2 unresolved, F2.1 resolved, F2.2 unresolved
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "verify",
"commit": "0428d9464",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "resolved"
},
{
"id": "F1.2",
"status": "unresolved"
},
{
"id": "F2.1",
"status": "resolved"
},
{
"id": "F2.2",
"status": "unresolved"
}
],
"findings": [
{
"id": "F3.1",
"severity": "P1",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 101,
"claim": "Changing the display language clears an existing notice before its replacement arrives.",
"scenario": "A signed-in user with a visible notice switches from English to Spanish in the user menu. The cache lookup misses because the stored answer is in English, so the strip disappears and the page shifts while the request is pending. If the request returns 503, the strip stays hidden. On the base branch, the strip remains visible while the translation is loading.",
"action": "Keep the current account's visible notices during a language refresh. Replace them when a matching request succeeds and clear them when the authenticated account changes.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.2",
"severity": "P2",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 103,
"claim": "A tab can keep showing the previous account's notice after another tab completes a sign-in.",
"scenario": "Tab 1 shows account A's notice. Tab 2 signs in as B over the existing session and finishes loading B's profile. Returning to tab 1 calls the listener captured for A. The request uses B's token, and the new username check discards B's response. Tab 1 keeps showing A's notice until a separate render or reload.",
"action": "Update the hook when the authenticated session changes. Clear notices from the previous session and fetch for the current account once its profile is available.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.3",
"severity": "P2",
"tag": null,
"file": "src/components/common/__tests__/limitNoticePayload.test.js",
"line": 118,
"claim": "The cache test checks the freshness predicate without exercising the display or request behavior it names.",
"scenario": "If the account hook starts requesting on every reload despite a fresh empty cache, this test still passes because it never observes a request. The account-specific subscription that refreshes a visible notice on return is also outside the test.",
"action": "Test the account notice flow with a fake clock and request recorder. Assert that a cached notice renders immediately and refreshes on return, and that a fresh empty answer suppresses the request.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Pass 3 (commit 500c620):
|
|
Simplification review (a fresh Claude subagent, commit 500c620) Verdict: findings, 3 findings.
findings.json{
"reviewer": "claude subagent",
"perspective": "simplify",
"mode": "full",
"commit": "500c620b4",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "S1",
"severity": null,
"tag": "yagni",
"file": "src/components/common/limitNoticePayload.js",
"line": 102,
"claim": "The NO_NOTICES_HOLD constant is used once, by isCacheFresh. The comment above it restates the code.",
"action": "Inline the value as `60 * 60 * 1000` and shorten the comment to one line.",
"lines_delta": -2,
"confidence": "low",
"scenario": null
},
{
"id": "S2",
"severity": null,
"tag": "shrink",
"file": "src/components/common/useNotices.js",
"line": 99,
"claim": "The askUnlessNone helper is called twice, and the second call re-reads the cache. It forces a second readCache just to share a name.",
"action": "Define `const ask = cached => { if(!cached || cached.length) load() }` once outside the effect body, or keep it inline. The current form is fine, so cut only if the cost matters.",
"lines_delta": -2,
"confidence": "low",
"scenario": null
},
{
"id": "S3",
"severity": null,
"tag": "dup-test",
"file": "src/components/common/__tests__/limitNoticePayload.test.js",
"line": 118,
"claim": "The `isCacheFresh({}, now)` and `isCacheFresh({notices: []}, now)` assertions overlap with null and no-timestamp cases: both exercise the 'not an array / no at' path.",
"action": "Drop the `{}` assertion and keep null, no-timestamp and the boundary cases.",
"lines_delta": -1,
"confidence": "low",
"scenario": null
}
]
} |
|
Simplification review (commit 6ac75d6): one of three taken.
|
|
Codex check of commits 0428d94..6ac75d6 (codex-cli 0.169.0, commit 6ac75d6) Verdict: findings, 1 finding.
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "final",
"commit": "6ac75d643",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "FC.1",
"severity": "P2",
"tag": null,
"file": "src/components/common/useNotices.js",
"line": 101,
"claim": "A notice from an earlier sign-in can reappear after the tab switches accounts and then switches back.",
"scenario": "Account A sees a notice that could not be cached because session storage was full. The same mounted tab renders account B after a sign-in in another tab, but B's notice request returns 503. When the tab renders A again, the old notice immediately reappears and stays if A's refresh also fails, even if the underlying issue was resolved while A was away.",
"action": "Clear the displayed notice state on every account change when there is no matching cache entry. Preserve the previous display during a language refresh for the same account.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Last check, one P2, accepted:
|
snyaggarwal
left a comment
There was a problem hiding this comment.
Approve. Merge any time. It doesn't depend on its sibling PRs, and the ocl_online#856 branch goes on top of it.
Open Core: clean. The hook keeps displaying what GET /capabilities/notices/ sends, and has no wording or rules of its own about what a notice is for. The commits, PR text and comments are neutral too.
How often it asks (page load and return only):
AccountNoticesis mounted once, inHeaderat the App level, so navigating inside the app doesn't ask again. Only a full page load does.watchReturnsfires once a return (theawayflag), with one listener for the whole app.- With notices showing, it's one request a page load and one a return. With none, at most one an hour, because
isCacheFreshholds a stored "none" for that long. - A server without the notices route (404) is stored as "none", so it asks at most once an hour too. Before, it asked once a session.
A failed request now keeps what's shown instead of clearing it. An answer for someone who is no longer signed in on this device is ignored. A change of language keeps the notices until the new language's answer arrives.
The P2s you left open (two people signing in one after the other in the same browser, storage that can't be written) are as described, and are no worse than main. I'm not re-raising them.
CI (Lint and test) is green.
Merge order in its group: on its own, any order relative to OpenConceptLab/oclinfrastructure#52, ocl-ai-assistant#264, ocl_online_api#132 and ocl-analytics-web#9.
Linked Issue
Advances OpenConceptLab/ocl_online#845
What this changes
While a person has account notices, TBv3 asks for them again at each page load and each time they come back to the page. Until now it asked once and kept the answer until the tab was closed, so a notice stayed after what it was about had changed somewhere else: in another tab, or on another site.
Nothing anyone sees changes otherwise: the same notices, in the same place. The API doesn't change.
How it was checked
npm testpasses (358) and ESLint is clean. In a browser, against a local API:Reviews
Three Codex passes, a simplification review and a last check are in the comments, with the answers. Every P1 is fixed. The two P2s left open need a second person to sign in over the first in the same browser.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7