fix: avoid MySQL thread_meta refresh races and harden roundtable bootstrap

Skip post-commit ORM refresh on threads_meta creates so concurrent MySQL
read/write-split deployments no longer fail with Could not refresh instance;
clean up partial roundtable threads on checkpoint failure, and ship related
position-roundtable/frontend build fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
董宏凯andCursor committed 2026-07-31 21:00:56 +08:00
1 parent e52261fc3d
commit a9d66536c3
12 files changed
+503 -127

No files matched your search

@@ -158,12 +158,21 @@ export async function replacePositionRoles(roles: PositionRole[]): Promise<Posit
return saved;
}
export function usePositionRoles(options?: { enabled?: boolean }) {
export function usePositionRoles(options?: {
/** Whether this query should run. */
enabled?: boolean;
/**
* Consumers that edit business-chain seats need the latest shared directory
* whenever their page is opened or focused.
*/
refreshOnMountOrFocus?: boolean;
}) {
return useQuery({
queryKey: POSITION_ROLES_QUERY_KEY,
queryFn: listPositionRoles,
staleTime: 30_000,
refetchOnWindowFocus: false,
refetchOnMount: options?.refreshOnMountOrFocus ? "always" : true,
refetchOnWindowFocus: options?.refreshOnMountOrFocus ? "always" : false,
enabled: options?.enabled ?? true,
});
}