Skip to content

refactor(data): scope async resource consumers - #563

Open
beruro wants to merge 10 commits into
junyu/async-resource-lifecyclefrom
junyu/scoped-loader-consumers
Open

refactor(data): scope async resource consumers#563
beruro wants to merge 10 commits into
junyu/async-resource-lifecyclefrom
junyu/scoped-loader-consumers

Conversation

@beruro

@beruro beruro commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

Shared application loaders could publish late results after project, workspace, session, or browser scope changes. Some polling/countdown work also continued while hidden, and browser diagnostic state could outlive the surface that owned it.

Solution

  • Migrate application, project, browser, git, settings, policy, skill, terminal, and sidebar consumers to the scoped async-resource lifecycle introduced by refactor(async): add scoped resource lifecycle #562.
  • Fence late results by stable scope identity and suspend eligible polling/countdowns while hidden.
  • Preserve copied error stacks and browser diagnostic scopes only for their valid lifecycle.
  • Integrate the latest refactor(async): add scoped resource lifecycle #562 base while retaining its newer view isolation, bounded-concurrency, permissions, and selected-repository behavior.
  • Keep the latest useGitHubWorkItemsLoadLifecycle implementation from the base because it now owns a more advanced viewer-isolated retention and permission lifecycle than this older sweep; its focused tests still pass.

The updated branch is based on the current #562 head and GitHub reports it mergeable.

Potential risks

  • This remains a broad 40-file consumer sweep; an incorrect scope key can still expose stale cross-project data.
  • Browser close/unmount, visibility return, and project reactivation are the highest lifecycle-risk paths.
  • The GitHub work-items loader no longer changes in this PR because the base implementation superseded that portion of the original sweep. Future lifecycle changes there must preserve viewer/store isolation and bounded concurrency.
  • This PR depends on refactor(async): add scoped resource lifecycle #562 and should be merged/retargeted only after refactor(async): add scoped resource lifecycle #562. Rollback is a normal revert after its base lands; no schema, wire, dependency, or persistence migration is involved.

Verification

  • ./node_modules/.bin/vitest run src/modules/MainApp/WorkManagement/useGitHubWorkItemsLoadLifecycle.test.tsPASS, 6 passed / 0 failed.
  • ./node_modules/.bin/eslint on the five integration-conflict files — PASS, no errors or warnings.
  • ./node_modules/.bin/tsc --noEmit --pretty falsePASS.
  • git diff --checkPASS.
  • Merge of the updated refactor(async): add scoped resource lifecycle #562 branch — PASS after semantic conflict resolution; final diff remains limited to 40 scoped-lifecycle consumer files.
  • Full repository CI is running on the published merge commit.

@beruro
beruro force-pushed the junyu/async-resource-lifecycle branch from 9c4d6e6 to eb16aff Compare July 30, 2026 07:07
@beruro
beruro force-pushed the junyu/scoped-loader-consumers branch from d2355fc to 5f7f585 Compare July 30, 2026 07:07
@beruro
beruro force-pushed the junyu/async-resource-lifecycle branch from eb16aff to 59189c0 Compare July 30, 2026 07:49
@beruro
beruro force-pushed the junyu/scoped-loader-consumers branch from 5f7f585 to 3e6b103 Compare July 30, 2026 07:49
@beruro
beruro force-pushed the junyu/async-resource-lifecycle branch from 59189c0 to a739c82 Compare July 30, 2026 08:04
@beruro
beruro force-pushed the junyu/scoped-loader-consumers branch from 3e6b103 to c294fbf Compare July 30, 2026 08:04
@beruro
beruro force-pushed the junyu/async-resource-lifecycle branch from a739c82 to d16c8e5 Compare July 30, 2026 15:09
beruro added 2 commits August 8, 2026 20:51
…e-lifecycle' into HEAD

# Conflicts:
#	src/engines/ChatPanel/panels/ProjectPanelView.tsx
#	src/modules/MainApp/WorkManagement/useGitHubWorkItemsLoadLifecycle.ts
#	src/modules/ProjectManager/LinearProjects/useLinearIndexData.tsx
#	src/modules/ProjectManager/WorkItems/hooks/useProjectData/useProjectData.ts
#	src/modules/WorkStation/CodeEditor/Panels/EditorPrimarySidebar/hooks/useWorkstationIssues.ts
…e-lifecycle' into HEAD

# Conflicts:
#	src/modules/ProjectManager/WorkItems/hooks/useProjectData/useProjectData.ts
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