feat: show persisted investment data and sync state

Consume the provided resource-envelope API snapshot. Preserve financial snapshots during
refresh, observe synchronization without importing, and fence late responses across
account and connection changes.
This commit is contained in:
2026-09-26 21:22:49 +03:00
parent b987fd8e78
commit 4e5f564fa1
81 changed files with 4714 additions and 1420 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import type { FC, PropsWithChildren } from "react";
import { describe, expect, it } from "vitest";
import { apiClient, apiQueryClient, useAuthenticatedQuery } from "@/shared/api";
import { createTestQueryClient } from "@/test/query";
import { resource } from "@/test/resource";
import { server } from "@/test/server";
import { AuthProvider, useAuth } from "./auth";
@@ -24,7 +25,7 @@ describe("AuthProvider", () => {
),
http.get("*/api/v1/brokerage-accounts", ({ request }) => {
authorization = request.headers.get("Authorization");
return HttpResponse.json([]);
return HttpResponse.json(resource([]));
}),
);
const queryClient = createTestQueryClient();
+1 -1
View File
@@ -143,8 +143,8 @@ const AuthProvider: FC<PropsWithChildren> = (props) => {
refresh,
clear: clearSession,
});
return () => configureAuthClient(null);
});
useEffect(() => () => configureAuthClient(null), []);
return (
<AuthContext