{"record":{"id":"7e195231b1b21dcd","repo":"gastownhall/beads","slug":"store-does-not-support-config-deletion","errorCode":null,"errorMessage":"store does not support config deletion","messagePattern":"store does not support config deletion","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/notion.go","lineNumber":717,"sourceCode":"func notionConfigDeleteTarget() notionConfigDeleter {\n\tif store == nil {\n\t\treturn nil\n\t}\n\tdeleter, _ := storage.UnwrapStore(store).(notionConfigDeleter)\n\treturn deleter\n}\n\nfunc saveNotionTargetConfigWithWriter(ctx context.Context, setter notionConfigSetter, deleter notionConfigDeleter, dataSourceID, viewURL string) error {\n\tif setter == nil {\n\t\treturn fmt.Errorf(\"database not available\")\n\t}\n\tif err := setter.SetConfig(ctx, \"notion.data_source_id\", strings.TrimSpace(dataSourceID)); err != nil {\n\t\treturn fmt.Errorf(\"save notion.data_source_id: %w\", err)\n\t}\n\tviewURL = strings.TrimSpace(viewURL)\n\tif viewURL == \"\" {\n\t\tif deleter == nil {\n\t\t\treturn fmt.Errorf(\"store does not support config deletion\")\n\t\t}\n\t\tif err := deleter.DeleteConfig(ctx, \"notion.view_url\"); err != nil {\n\t\t\treturn fmt.Errorf(\"clear notion.view_url: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n\tif err := setter.SetConfig(ctx, \"notion.view_url\", viewURL); err != nil {\n\t\treturn fmt.Errorf(\"save notion.view_url: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc writeNotionJSON(cmd *cobra.Command, value interface{}) error {\n\tencoder := json.NewEncoder(cmd.OutOrStdout())\n\tencoder.SetIndent(\"\", \"  \")\n\treturn encoder.Encode(value)\n}\n","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/notion.go#L699-L735","documentation":"saveNotionTargetConfigWithWriter deletes 'notion.view_url' when an empty view URL is supplied, but deletion requires a deleter capability. If the store passed in implements only notionConfigSetter and its deleter is nil, this error is thrown: the store does not support config deletion.","triggerScenarios":"Calling bd notion init/connect (or the anonymous caller) with viewURL == \"\" (to clear the view URL) against a store whose DeleteConfig capability is nil — i.e. a store implementation that lacks the config-deletion interface.","commonSituations":"Users clearing the Notion view URL ('bd notion init --data-source-id X' with no --view-url) while connected to a store/remote or older storage backend that doesn't implement config deletion.","solutions":["Use a store that implements config deletion (upgrade beads / use the default Dolt store).","Provide a non-empty --view-url so the deleter path is skipped and the URL is overwritten instead.","Update the existing notion.view_url to a placeholder then remove it with a deletion-capable store.","Check which store the --db flag points to; switch to a deletion-capable backend."],"exampleFix":"// before\nbd notion init --data-source-id abc            # clears view_url; store lacks deletion -> error\n// after\nbd notion init --data-source-id abc --view-url https://notion.so/my-view","handlingStrategy":"fallback","validationCode":"if viewURL == \"\" {\n    if deleter == nil {\n        // pre-check: cannot clear view_url on this store\n        return errors.New(\"current store cannot delete config; provide --view-url or upgrade\")\n    }\n}","typeGuard":"func supportsConfigDelete(s interface{}) bool {\n    d, ok := s.(interface{ DeleteConfig(context.Context, string) error })\n    return ok && d != nil\n}","tryCatchPattern":"if err := saveNotionTargetConfigWithWriter(ctx, setter, deleter, dsID, viewURL); err != nil {\n    if strings.Contains(err.Error(), \"does not support config deletion\") {\n        // retry with a non-empty viewURL or a deletion-capable store\n    }\n    return err\n}","preventionTips":["Use the default Dolt store which supports config deletion","Always pass --view-url when the backend may lack deletion support","Check store capabilities before attempting clears","Upgrade beads if your backend predates config deletion"],"tags":["go","config","notion","capability"],"backgroundTag":"unsupported-store-capability","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}