On this page
Overview
Deletes empty chats and associated/empty memory records inside the current app data scope.
- Artifact
DataMaintenance.js· esm - Classification
public first party - Availability
Browser / native WebView - Normalization
Normalized counts; destructive storage failures preserved.
Import and lifecycle
import * as module from '/arcane/modules/DataMaintenance.js';
Import initializes DBOPFS if needed; clearEmptyChatsAndMemories reads chats and memories and permanently deletes empty chats plus associated or empty memories.
Application-facing behavior: clearEmptyChatsAndMemories() plus content predicates.
Protocol and host implementation
Global DBOPFS This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
clearEmptyChatsAndMemories | function | async function clearEmptyChatsAndMemories() | — |
hasConversationEntry | re-export | hasConversationEntry | — |
hasMemoryContent | re-export | hasMemoryContent | — |
hasUserEntry | re-export | hasUserEntry | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
clearEmptyChatsAndMemories | exported-function | async function clearEmptyChatsAndMemories() | — |
Parameter meanings and results
clearEmptyChatsAndMemories() waits for window.dbopfs and returns {checkedChats, checkedMemories, deletedChats, deletedMemories, failed}. hasConversationEntry preserves user-authored chats and complete assistant-only model openings; hasUserEntry and hasMemoryContent remain available for their narrower predicates.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
- consumes dbopfs-ready
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- DBOPFS and storage read or delete failures propagate
- per-item delete rejections contribute to failed
Availability and capabilities
Browser / native WebView. Normalized counts; destructive storage failures preserved.
Browser and native-WebView application-data maintenance over app-scoped OPFS with no Core service.
Contract example
import {clearEmptyChatsAndMemories} from '/arcane/modules/DataMaintenance.js';
// Destructive: run only after the user chooses to remove empty records.
const report=await clearEmptyChatsAndMemories();
console.log(report);
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.