Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: deleteAll() now deletes Durable Object alarm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the title uses singular "alarm" but the rest of the PR (compatibility flag description, partial) uses plural "alarms". Consider pluralizing for consistency, since a Durable Object can have an active alarm that deleteAll() will delete.

Suggested change
title: deleteAll() now deletes Durable Object alarm
title: deleteAll() now deletes Durable Object alarms

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/bonk Changelog should use singular "alarm" everywhere

description: Clean up a Durable Object's storage with a single API call.
products:
- durable-objects
- workers
date: 2026-02-24
---

`deleteAll()` now deletes a Durable Object alarm in addition to stored data for Workers with a compatibility date of `2026-02-24` or later. This change simplifies clearing a Durable Object's storage with a single API call.

Previously, `deleteAll()` only deleted user-stored data for an object. Alarm usage stores metadata in an object's storage, which required a separate `deleteAlarm()` call to fully clean up all storage for an object. The `deleteAll()` change applies to both KV-backed and SQLite-backed Durable Objects.

```js
// Before: two API calls required to clear all storage
await this.ctx.storage.deleteAlarm();
await this.ctx.storage.deleteAll();

// Now: a single call clears both data and the alarm
await this.ctx.storage.deleteAll();
```

For more information, refer to the [Storage API documentation](/durable-objects/api/sqlite-storage-api/#deleteall).
14 changes: 14 additions & 0 deletions src/content/compatibility-flags/delete-all-deletes-alarm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
_build:
publishResources: false
render: never
list: never

name: "Durable Object `deleteAll()` deletes alarms"
sort_date: "2026-02-24"
enable_date: "2026-02-24"
enable_flag: "delete_all_deletes_alarm"
disable_flag: "delete_all_preserves_alarm"
---

With the `delete_all_deletes_alarm` flag set, calling `deleteAll()` on a Durable Object's storage will delete any active alarm in addition to all stored data. Previously, `deleteAll()` only deleted user-stored data, and alarms required a separate `deleteAlarm()` call to remove. This change applies to both KV-backed and SQLite-backed Durable Objects.
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ export class Subscription extends DurableObject<Env> {

### Clean up storage with `deleteAll()`

To fully clear a Durable Object's storage, call `deleteAll()`. Simply deleting individual keys or dropping tables is not sufficient, as some internal metadata may remain. If you have alarms set, delete those first.
To fully clear a Durable Object's storage, call `deleteAll()`. Simply deleting individual keys or dropping tables is not sufficient, as some internal metadata may remain. Workers with a compatibility date before [2026-02-24](/workers/configuration/compatibility-flags/#delete-all-deletes-alarms) and an alarm set should delete the alarm first with `deleteAlarm()`.

<TypeScriptExample filename="index.ts">
```ts
Expand All @@ -1422,10 +1422,8 @@ export interface Env {

export class ChatRoom extends DurableObject<Env> {
async clearStorage() {
// If you have an alarm set, delete it first
await this.ctx.storage.deleteAlarm();

// Delete all storage
// Delete all storage, including any set alarm
await this.ctx.storage.deleteAll();

// The Durable Object instance still exists, but with empty storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Type, MetaInfo } from "~/components";
- <code>deleteAll(options <Type text="Object" /> <MetaInfo text="optional" />)</code>: <Type text="Promise" />
- Deletes all stored data, effectively deallocating all storage used by the Durable Object. For Durable Objects with a key-value storage backend, `deleteAll()` removes all keys and associated values for an individual Durable Object. For Durable Objects with a [SQLite storage backend](/durable-objects/best-practices/access-durable-objects-storage/#create-sqlite-backed-durable-object-class), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database, including both SQL data and key-value data.
- For Durable Objects with a key-value storage backend, an in-progress `deleteAll()` operation can fail, which may leave a subset of data undeleted. Durable Objects with a SQLite storage backend do not have a partial `deleteAll()` issue because `deleteAll()` operations are atomic (all or nothing).
- `deleteAll()` does not proactively delete [alarms](/durable-objects/api/alarms/). Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) to delete an alarm.
- For Workers with a compatibility date of `2026-02-24` or later, `deleteAll()` also deletes any active [alarm](/durable-objects/api/alarms/). For earlier compatibility dates, `deleteAll()` does not delete alarms. Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) separately, or enable the `delete_all_deletes_alarm` [compatibility flag](/workers/configuration/compatibility-flags/).

### `transactionSync`

Expand Down