{"record":{"id":"75e389824737faf4","repo":"toeverything/AFFiNE","slug":"method-not-implemented","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"blocksuite/affine/blocks/data-view/src/data-source.ts","lineNumber":231,"sourceCode":"    );\n  }\n\n  propertyDataSet(propertyId: string, data: Record<string, unknown>): void {\n    const viewColumn = this.getViewColumn(propertyId);\n    if (viewColumn) {\n      viewColumn.data = data;\n    }\n  }\n\n  propertyDelete(_id: string): void {\n    const index = this.block.props.columns.findIndex(v => v.id === _id);\n    if (index >= 0) {\n      this.block.props.columns.splice(index, 1);\n    }\n  }\n\n  propertyDuplicate(_columnId: string): string | undefined {\n    throw new Error('Method not implemented.');\n  }\n\n  propertyMetaGet(type: string): PropertyMetaConfig {\n    const meta = this.columnMetaMap.get(type);\n    if (meta) {\n      return meta;\n    }\n    return queryBlockAllColumnMap[type];\n  }\n\n  propertyNameGet(propertyId: string): string {\n    const viewColumn = this.getViewColumn(propertyId);\n    if (viewColumn) {\n      return viewColumn.name;\n    }\n    if (propertyId === 'type') {\n      return 'Block Type';\n    }","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/26c515e050211269e911f7d9cfe162a26c83ed98/blocksuite/affine/blocks/data-view/src/data-source.ts#L213-L249","documentation":"BlockQueryDataSource.propertyDuplicate is an unimplemented stub: it throws a plain 'Method not implemented.' This data source derives its rows from blocks matching a selector, and its columns from block meta plus user columns; duplicating a column has no defined semantics here, unlike DatabaseBlockDataSource which fully implements propertyDuplicate. Any UI or command that invokes duplicate on a block-query view hits this.","triggerScenarios":"Invoking the 'duplicate property/column' affordance on a DataView block backed by BlockQueryDataSource (data-view block whose dataSource type resolves to block-query). Programmatic calls to dataSource.propertyDuplicate(columnId) on such a source. Calling databaseViewInitTemplate or any generic data-view operation that assumes the full DatabaseBlockDataSource contract.","commonSituations":"Reusing database-block UI components against a BlockQueryDataSource; rendering a custom view type that exposes a duplicate-column button without gating it on dataSource capabilities; version upgrades that added the duplicate affordance to shared data-view chrome.","solutions":["Gate the duplicate-column UI/action on the data source type: disable or hide it for BlockQueryDataSource (check dataSource.meta or the block flavour), enable it only for DatabaseBlockDataSource.","If you need duplication for block-query, implement propertyDuplicate in a subclass following DatabaseBlockDataSource.propertyDuplicate (addProperty + copyCellsByProperty).","Avoid calling generic data-view helpers that assume all DataSourceBase methods are implemented; branch on the concrete data source class."],"exampleFix":"// before\ndataSource.propertyDuplicate(columnId); // throws\n\n// after\nimport type { DatabaseBlockDataSource } from '@blocksuite/affine-block-database';\nif (dataSource instanceof DatabaseBlockDataSource) {\n  dataSource.propertyDuplicate(columnId);\n}","handlingStrategy":"type-guard","validationCode":"import type { DataSourceBase } from '@blocksuite/data-view';\nimport type { DatabaseBlockDataSource } from '@blocksuite/affine-block-database';\nfunction canDuplicate(ds: DataSourceBase): ds is DatabaseBlockDataSource {\n  return ds instanceof DatabaseBlockDataSource;\n}","typeGuard":"import { DatabaseBlockDataSource } from '@blocksuite/affine-block-database';\nfunction isDatabaseDataSource(ds: unknown): ds is DatabaseBlockDataSource {\n  return ds instanceof DatabaseBlockDataSource;\n}","tryCatchPattern":null,"preventionTips":["Gate column-duplicate UI on the concrete data source type.","Do not call DataSourceBase methods on BlockQueryDataSource that it stubs out.","Document which methods BlockQueryDataSource intentionally leaves unimplemented."],"tags":["data-view","block-query","not-implemented","property-duplicate"],"backgroundTag":null,"analyzedSha":"26c515e050211269e911f7d9cfe162a26c83ed98","analyzedAt":"2026-08-12T13:15:16.447Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}