feat: continue tree rust family cutover
- add rust renderer/state-family scaffolds and inline compat host thinning for page tree, file tree, and picker - route tree/filetree preflight, file projection, resource artifact, and stream delta contracts through rust plans - preserve canonical move-order validation, file-tree search projection, and related frontend/runtime regression coverage
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import type { ConvexHttpClient } from "convex/browser";
|
||||
import type { Id } from "../../../convex/_generated/dataModel";
|
||||
import { api } from "@/lib/convex/api";
|
||||
import {
|
||||
buildDocumentBridgeMutationRequest,
|
||||
executeDocumentBridgeMutationRequest,
|
||||
type CommandEnvelope,
|
||||
type BridgeContext,
|
||||
} from "@/lib/documents/bridge";
|
||||
import {
|
||||
recordBridgeCommandArtifacts,
|
||||
recordBridgeCommandFailureArtifacts,
|
||||
recordRustBridgeCommandArtifacts,
|
||||
} from "@/lib/documents/bridge-log";
|
||||
import {
|
||||
executeRustBridgeMutationTransport,
|
||||
resolveRustBridgeCommandPlan,
|
||||
} from "@/lib/documents/rust-runtime";
|
||||
|
||||
export type MediaAssetReplaceStoragePayload = {
|
||||
assetId: string;
|
||||
@@ -32,21 +32,21 @@ export async function executeMediaAssetWritebackBridgeCommand(input: {
|
||||
context: BridgeContext;
|
||||
envelope: CommandEnvelope<MediaAssetReplaceStoragePayload>;
|
||||
}): Promise<MediaAssetWritebackExecutionResult> {
|
||||
const mutationRequest = buildDocumentBridgeMutationRequest({
|
||||
const plan = await resolveRustBridgeCommandPlan({
|
||||
context: input.context,
|
||||
envelope: input.envelope,
|
||||
mapConvexArgs: (payload) => ({
|
||||
userId: payload.userId,
|
||||
id: payload.assetId,
|
||||
storageId: payload.storageId as Id<"_storage">,
|
||||
}),
|
||||
});
|
||||
|
||||
try {
|
||||
await executeDocumentBridgeMutationRequest({
|
||||
const transportResult = await executeRustBridgeMutationTransport({
|
||||
client: input.client,
|
||||
mutation: api.mediaAssets.replaceStorageFromUpload,
|
||||
request: mutationRequest,
|
||||
plan,
|
||||
});
|
||||
await recordRustBridgeCommandArtifacts({
|
||||
client: input.client,
|
||||
context: input.context,
|
||||
envelope: input.envelope,
|
||||
plan,
|
||||
result: transportResult,
|
||||
});
|
||||
} catch (error) {
|
||||
await recordBridgeCommandFailureArtifacts({
|
||||
@@ -58,17 +58,6 @@ export async function executeMediaAssetWritebackBridgeCommand(input: {
|
||||
throw error;
|
||||
}
|
||||
|
||||
try {
|
||||
await recordBridgeCommandArtifacts({
|
||||
client: input.client,
|
||||
context: input.context,
|
||||
envelope: input.envelope,
|
||||
});
|
||||
} catch (error) {
|
||||
// 说明:OnlyOffice callback 写回的主事实是附件存储替换;日志落账失败不应反向导致保存失败。
|
||||
console.warn("[onlyoffice/callback] bridge log write skipped:", error);
|
||||
}
|
||||
|
||||
return {
|
||||
requestId: input.context.requestId,
|
||||
traceId: input.context.traceId,
|
||||
|
||||
Reference in New Issue
Block a user