{"record":{"id":"568f6e3fec151319","repo":"siyuan-note/siyuan","slug":"unsupported-attribute-view-row-sort-operation-s","errorCode":null,"errorMessage":"unsupported attribute view row sort operation %s","messagePattern":"unsupported attribute view row sort operation (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/api/av_row_sort.go","lineNumber":52,"sourceCode":"func avRowOrder(value *model.AttributeViewRowOrder) *apicontract.AVRowOrder {\n\tif value == nil {\n\t\treturn nil\n\t}\n\treturn &apicontract.AVRowOrder{ItemIDs: value.ItemIDs, Groups: value.Groups, Sorts: avContractSlice(value.Sorts, toContractAVViewSort)}\n}\n\nfunc avRowSortOperations(values []*model.Operation) ([]*apicontract.AVRowSortOperation, error) {\n\tif values == nil {\n\t\treturn nil, nil\n\t}\n\tret := make([]*apicontract.AVRowSortOperation, len(values))\n\tfor i, value := range values {\n\t\tif value == nil {\n\t\t\tcontinue\n\t\t}\n\t\tdata, ok := value.Data.(*model.AttributeViewRowOrderChange)\n\t\tif !ok || value.Action != \"sortAttrViewRow\" {\n\t\t\treturn nil, fmt.Errorf(\"unsupported attribute view row sort operation %s\", value.Action)\n\t\t}\n\t\tvar change *apicontract.AVRowOrderChange\n\t\tif data != nil {\n\t\t\tchange = &apicontract.AVRowOrderChange{RowOrder: avRowOrder(data.RowOrder), Expected: avRowOrder(data.Expected), ValidateGroup: data.ValidateGroup}\n\t\t}\n\t\tret[i] = &apicontract.AVRowSortOperation{Action: value.Action, Data: change, ID: value.ID, RootID: value.RootID, ParentID: value.ParentID, PreviousID: value.PreviousID, NextID: value.NextID, BlockIDs: value.BlockIDs, BlockID: value.BlockID, DeckID: value.DeckID, AvID: value.AvID, SrcIDs: value.SrcIDs, IsDetached: value.IsDetached, Name: value.Name, Typ: value.Typ, Format: value.Format, KeyID: value.KeyID, RowID: value.RowID, IsTwoWay: value.IsTwoWay, BackRelationKeyID: value.BackRelationKeyID, RemoveDest: value.RemoveDest, Layout: string(value.Layout), GroupID: value.GroupID, TargetGroupID: value.TargetGroupID, ViewID: value.ViewID, ViewIDs: value.ViewIDs, IgnoreDefaultFill: value.IgnoreDefaultFill}\n\t}\n\treturn ret, nil\n}\n","sourceCodeStart":34,"sourceCodeEnd":62,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/api/av_row_sort.go#L34-L62","documentation":"avRowSortOperations converts row-sort transactions; every non-nil value must have Action == \"sortAttrViewRow\" and data of type *model.AttributeViewRowOrderChange. Any other action string or payload type makes it return this error naming the offending action.","triggerScenarios":"A transaction item in the batch has a different action (e.g. sortAttrColRow, insertAttrViewRow) but was passed to the row-sort mapping endpoint; or Data is not an AttributeViewRowOrderChange.","commonSituations":"Frontend/plugin mixing multiple transaction action types in one batch call; API version drift where the action string was renamed; plugin sending the wrong Data shape.","solutions":["Send only items whose Action is exactly \"sortAttrViewRow\" to this endpoint","Split mixed batches: route other actions to their respective endpoints","Check the Data field is *AttributeViewRowOrderChange with RowOrder/Expected populated"],"exampleFix":"// before\n{action: \"sortAttrViewColRow\", data: {...}}\n// after\n{action: \"sortAttrViewRow\", data: {rowOrder: [...], expected: [...]}}","handlingStrategy":"type-guard","validationCode":"if (op.action !== 'sortAttrViewRow') throw new Error('not a row sort op');\nif (!op.data || !Array.isArray(op.data.rowOrder)) throw new Error('missing rowOrder');","typeGuard":"const isRowSort = (op) => op?.action === 'sortAttrViewRow' && op?.data?.rowOrder != null;","tryCatchPattern":"try { await avRowSort(ops) } catch (e) { if (/unsupported attribute view row sort/.test(e)) ops = ops.filter(isRowSort); retry(); }","preventionTips":["Filter transaction batches by action before calling each endpoint","Keep client action strings in sync with kernel constants","Add unit tests for action-string renames"],"tags":["attribute-view","api","validation"],"backgroundTag":"unsupported-operation","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}