Repository navigation
FIX: Bind Attack History requests to the runtime generation - #3894
hannahwestra25 merged 5 commits into
Conversation
Attack History did not read useRuntime(), so a list response from the previous runtime could land after RuntimeProvider reported a new generation, and a later page's cursor and cached filter options carried over to the new runtime. Key list requests by runtime generation as well as filters, so a new generation cancels the in-flight request, drops the old cursor and loads page 1. Re-request filter options per generation, ignore late responses and clear the previous generation's options before paint. Send no requests until the runtime is ready. Fixes microsoft#3745 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the runtime-aware Attack History changes.
No open issues 🎉
What changed in this PR
Binds Attack History requests to the runtime generation, addressing #3745 and aligning History with the existing Dataset and Analytics reload behavior.
Changes:
- Gates history and filter-option requests on runtime readiness and ignores responses from obsolete requests.
- Resets pagination to the first page and clears cached filter options when the runtime generation changes.
- Adds three regression tests covering readiness, stale list responses, and reconnect pagination with fresh options.
| File | Description |
|---|---|
| frontend/src/components/History/AttackHistory.tsx | Adds runtime-aware request handling, pagination invalidation, and filter-option resets. |
| frontend/src/components/History/AttackHistory.test.tsx | Adds runtime mocks and regression tests for readiness and generation changes. |
Review effort: Balanced
|
@microsoft-github-policy-service agree |
|
Thanks for contributing!! This branch conflicts with
Tests (
|
|
Thanks hannahwestra25! I merged the latest main and reapplied the fix in d0afcfa, keeping the current filters, option-error handling, and auto-refresh. History and filter-option requests now wait for runtime readiness. List requests and pagination use the generation plus filter key, and a generation change clears the old options and option errors. Auto-refresh also waits for readiness and cannot reuse the previous generation’s cursor. I updated the tests to use labels/operator options and added the two regressions you requested. There are seven runtime regression tests in total, covering readiness, stale list and option responses, reconnect pagination, clearing old operator options/errors, narrowed labels, and cursor-free auto-refresh. All 48 History tests pass on the pushed head; all seven new regressions fail against unmodified main. Lint, TypeScript checking, and the production build also pass. The broader frontend coverage run, before merging main’s latest attachment-upload commit, had 4,660 passing tests and three failures. All three reproduce on untouched main at 1d27ae7: the ScenarioDetail failed-preview accessibility test and the two App.drafts new-conversation route tests. Coverage thresholds passed. I left those unrelated tests unchanged. Could you take another look when you have a chance? Thanks! |
Gate both list error render branches on the settled generation-aware list key. Cover replacement readiness, pending requests, settled success and failure, and late obsolete rejections without changing request lifecycles. Signed-off-by: Rayeed Zaman <rayeedzaman@gmail.com>
…e conflicts Keep main's page-request pagination while binding requests and filter options to runtime generations. Preserve both regression suites. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…runtime-generation
|
Merged current main Fresh validation after |
|
thanks hannahwestra25! just wanted to let you know that im a cs major at georgia tech and if you guys are hiring interns, please let me know. happy to contribute on a larger scale. |
Description
Fixes #3745.
Bind Attack History requests, pagination and filter options to the current runtime generation. Requests wait for runtime readiness; late responses from an obsolete generation are ignored. Changing the runtime restarts pagination without a previous runtime's cursor and clears old filter options and errors before paint. Auto-refresh waits for readiness and settled list loading.
The implementation preserves main's page-request identity and cursor handling, quiet refresh, simplified filters, and option-error behavior. The PR changes only
AttackHistory.tsxand its tests relative to current main. No API or type changes.Validation
After merging upstream main
f6a664768in6dbed2a1619b4abe49b68b023319acd68d38343b:npm ci: 67 passed.npm run build): passed.npx tsc --project tsconfig.test.json --noEmit): passed.git diff --check: passed.The runtime regressions cover readiness, stale list responses and rejections, old list errors, reconnect pagination, old operator/options errors, narrowed labels, and cursor-free refresh. Earlier revisions demonstrated the original seven lifecycle regressions and the old-list-error regressions failing before their fixes; those historical baseline experiments were not repeated for this merge-only update.
The full frontend coverage suite and browser E2E were not rerun for this update. The earlier broad coverage run had three failures that also reproduced on its untouched main baseline; it is not a passing result for the current head. Hosted CI still requires maintainer approval to run.
AI assistance: verified and tested with OpenAI Codex.