Skip to content

refactor(async): add scoped resource lifecycle - #562

Open
beruro wants to merge 2 commits into
developfrom
junyu/async-resource-lifecycle
Open

refactor(async): add scoped resource lifecycle#562
beruro wants to merge 2 commits into
developfrom
junyu/async-resource-lifecycle

Conversation

@beruro

@beruro beruro commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

The legacy async-data helper does not make scope changes, stale completions, unmount cancellation, or hidden-window polling ownership explicit, allowing old requests and duplicate timers to outlive their consumer.

Solution

  • Introduce a scoped async-resource lifecycle with stale-result fencing and abort-on-scope-change/unmount behavior.
  • Add visibility-aware polling that pauses while hidden and resumes without duplicate timers.
  • Add shared latest-task and polling primitives with focused lifecycle tests.
  • Include architecture, UI-consistency, and performance-guard audit records.
  • Validation: 18 focused tests, TypeScript typecheck, changed-file ESLint, and diff check.

Potential risks

Verification

Previous GitHub CI on head 558770039:

  • pnpm install --frozen-lockfilePASS in Frontend (typecheck · lint · test).
  • pnpm typecheckPASS in Frontend (typecheck · lint · test).
  • pnpm lintPASS in Frontend (typecheck · lint · test).
  • pnpm run testPASS in Frontend (typecheck · lint · test).
  • node scripts/tauri/prepare-sidecars.cjs --profile debugPASS in Rust (clippy).
  • (cd src-tauri && cargo clippy --workspace --all-targets -- -D warnings)PASS in Rust (clippy).
  • AI-attribution history scan — PASS.

Current GitHub CI is re-running against the latest develop merge for head 5f991c2ed5; those results remain required before merge.

beruro added 2 commits August 10, 2026 13:24
Pre-commit hook ran. Total eslint: 10, total circular: 0
Pre-commit hook ran. Total eslint: 10, total circular: 0
@beruro
beruro force-pushed the junyu/async-resource-lifecycle branch from fb403e6 to 5f991c2 Compare August 10, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant