{"record":{"id":"af8ab44ff0387055","repo":"yuliskov/SmartTube","slug":"delete-is-not-implemented","errorCode":null,"errorMessage":"Delete is not implemented.","messagePattern":"Delete is not implemented\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"leanbackassistant/src/main/java/com/liskovsoft/leanbackassistant/search/VideoContentProvider.java","lineNumber":241,"sourceCode":"            mediaItem.getId()\n        };\n    }\n\n    @Nullable\n    @Override\n    public String getType(@NonNull Uri uri) {\n        return null;\n    }\n\n    @Nullable\n    @Override\n    public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {\n        throw new UnsupportedOperationException(\"Insert is not implemented.\");\n    }\n\n    @Override\n    public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) {\n        throw new UnsupportedOperationException(\"Delete is not implemented.\");\n    }\n\n    @Override\n    public int update(\n            @NonNull Uri uri,\n            @Nullable ContentValues contentValues,\n            @Nullable String s,\n            @Nullable String[] strings) {\n        throw new UnsupportedOperationException(\"Update is not implemented.\");\n    }\n}\n","sourceCodeStart":223,"sourceCodeEnd":253,"githubUrl":"https://github.com/yuliskov/SmartTube/blob/3de8d90593e0166f012ca18cc3c7ba45bfd68ac4/leanbackassistant/src/main/java/com/liskovsoft/leanbackassistant/search/VideoContentProvider.java#L223-L253","documentation":"VideoContentProvider is a read-only search-suggestions provider; delete() unconditionally throws UnsupportedOperationException('Delete is not implemented.') because deleting rows from the suggestion cache is not a supported operation — the cache is rebuilt from the media service data.","triggerScenarios":"Any getContentResolver().delete(uri, selection, args) call against this provider's authority, including cleanup routines and test teardown code.","commonSituations":"Sync/cleanup jobs iterating over all providers; tests that delete inserted rows on every provider; tooling that treats providers as databases.","solutions":["Remove delete() calls against this provider's URIs from your code or job.","Manage the underlying data through the app's own APIs (channels/playlists), not through the search provider.","If you fork the library and need deletion, implement delete() in the provider against your real store."],"exampleFix":"// before\ngetContentResolver().delete(searchUri, null, null); // throws\n\n// after — nothing to delete; the provider only serves search suggestions\n// via query(). Adjust the owning app's data instead.","handlingStrategy":"try-catch","validationCode":"// delete is unsupported by design; skip it for this authority\nif (!SEARCH_AUTHORITY.equals(uri.getAuthority())) {\n    getContentResolver().delete(uri, null, null);\n}","typeGuard":null,"tryCatchPattern":"try {\n    getContentResolver().delete(searchUri, null, null);\n} catch (UnsupportedOperationException e) { // Delete is not implemented\n    Log.w(TAG, \"Search provider is read-only: \" + searchUri);\n}","preventionTips":["Restrict cleanup jobs to writable providers (contacts, your own).","Remember all three mutators (insert/delete/update) throw on this provider."],"tags":["android","content-provider","read-only","crud"],"backgroundTag":"read-only-content-provider","analyzedSha":"3de8d90593e0166f012ca18cc3c7ba45bfd68ac4","analyzedAt":"2026-08-22T09:19:26.383Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}