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

beruro added 2 commits July 30, 2026 23:09
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 a739c82 to d16c8e5 Compare July 30, 2026 15:09
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