mirror of
https://github.com/block/buzz.git
synced 2026-11-04 16:31:38 +00:00
perf(desktop): restore project context during startup (#6939)
## Summary Project channels previously appeared as ordinary channels until the community-wide project enumeration completed, delaying the contextual right rail most noticeably on larger relays. - Restore the last fully validated, relay-and-identity-scoped project collection immediately while keeping live relay data authoritative. - Resolve the active channel's project home through scoped `#buzz-channel` queries instead of waiting for the complete project scan. - Keep snapshots aligned with community removal and relay reconnect invalidation. ### Related issue None found. ### Testing - Pre-push `file-size-check`, `desktop-check`, `desktop-typecheck`, and `desktop-test` - Project enumeration, snapshot persistence, and relay invalidation unit coverage - Targeted Playwright scenario: project sidebar rows open the home channel and nest extra channels No numeric startup benchmark was captured; this draft validates the cache and scoped-query behavior while leaving timing measurement for review. --------- Signed-off-by: Thomas Petersen <thomasp@squareup.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
addRepositoryToProject,
|
||||
eventToRepository,
|
||||
} from "@/features/projects/projectModels";
|
||||
import { markProjectDataAuthoritative } from "@/features/projects/projectSnapshot";
|
||||
import { publishProjectOwnerAnnouncement } from "@/shared/api/projectGit";
|
||||
import { relayClient } from "@/shared/api/relayClient";
|
||||
import type { RelayEvent } from "@/shared/api/types";
|
||||
@@ -315,6 +316,7 @@ export function useAddProjectRepositoryMutation() {
|
||||
mutationFn: (input: AddProjectRepositoryInput) =>
|
||||
addProjectRepository(input),
|
||||
onSuccess: ({ previousProjectId, project }) => {
|
||||
markProjectDataAuthoritative(project, "local-write");
|
||||
if (previousProjectId !== project.id) {
|
||||
queryClient.removeQueries({
|
||||
exact: true,
|
||||
|
||||
Reference in New Issue
Block a user