Browse SDKs · WASM
SDKsWASM

Clear local and server messages

Clear every message stored locally and on the server for the current account with the WASM SDK.

Copy

This operation clears every message stored locally and on the server for the current account. It affects all conversations and should not appear as a single-message or single-conversation action. The method has no application parameters.

await openimsdk.deleteAllMsgFromLocalAndSvr();
resetAllMessages();

This is an irreversible account-level operation, so require confirmation. When the Promise resolves, the server has completed the request and messages stored locally and on the server for the current account have been cleared. Then clear the current account's in-memory message lists, search results, and pagination state.

The operation does not delete copies already retained by other conversation members, and it does not mean that the current account's other devices have finished refreshing their interfaces. Update conversation summaries from subsequent conversation events. If state remains uncertain, query conversations and messages again and use the latest results.