diff --git a/go/buscalls/buscalls.go b/go/buscalls/buscalls.go index 2a773183..e127c4df 100644 --- a/go/buscalls/buscalls.go +++ b/go/buscalls/buscalls.go @@ -26,11 +26,8 @@ const ( ObjectsGet = "mesh/objects.get" ObjectsList = "mesh/objects.list" ObjectsDelete = "mesh/objects.delete" - // ObjectsPurge removes what a deleted object leaves behind, its chunks, from the store (H-A-366): asked with an - // ObjectsNameRequest, answered Done. - ObjectsPurge = "mesh/objects.purge" - ObjectsInfo = "mesh/objects.info" - ObjectsWatch = "mesh/objects.watch" + ObjectsInfo = "mesh/objects.info" + ObjectsWatch = "mesh/objects.watch" // ObjectsSentGet reads an object of a sender's store of sent objects by the reference a reply or an event carried // (design 47 G §347, §407), served under the standing grant the grants part derives from the manifests; the answer is // ObjectData. diff --git a/go/busstate/busstate.go b/go/busstate/busstate.go index 85f68b6b..71ff9b6c 100644 --- a/go/busstate/busstate.go +++ b/go/busstate/busstate.go @@ -78,10 +78,10 @@ func (o Objects) Delete(name string) error { return err } -// Purge removes what the deleted object name left behind in the store, its chunks, through the runtime (H-A-366): a -// bundle never opens a connection of its own for it. +// Purge removes what the deleted object name left behind in the store, its chunks, through the runtime's delete, which +// purges them again when asked again (H-A-366): a bundle never opens a connection of its own for it. func (o Objects) Purge(name string) error { - _, err := call[buscalls.Done](buscalls.ObjectsPurge, buscalls.ObjectsNameRequest{Objects: o.local, Name: name}) + _, err := call[buscalls.Done](buscalls.ObjectsDelete, buscalls.ObjectsNameRequest{Objects: o.local, Name: name}) return err } diff --git a/go/busstate/busstate_test.go b/go/busstate/busstate_test.go index 4fe3ec76..e557892b 100644 --- a/go/busstate/busstate_test.go +++ b/go/busstate/busstate_test.go @@ -69,7 +69,6 @@ func subABundleKeepsObjectsThroughTheRuntime(t *testing.T) { buscalls.ObjectsGet: buscalls.ObjectData{Info: buscalls.ObjectInfo{Name: "t1.part0"}, Data: []byte("hello")}, buscalls.ObjectsList: buscalls.ObjectsListed{Objects: []buscalls.ObjectInfo{{Name: "t1.part0"}}}, buscalls.ObjectsDelete: buscalls.Done{}, - buscalls.ObjectsPurge: buscalls.Done{}, buscalls.ObjectsInfo: buscalls.Fill{Count: 0, MaxBytes: 20 << 30}, } asked := map[string]map[string]any{} @@ -98,8 +97,8 @@ func subABundleKeepsObjectsThroughTheRuntime(t *testing.T) { t.Errorf("%s named the store %v, not its local name", method, p["objects"]) } } - if p := asked[buscalls.ObjectsPurge]; p["name"] != "t1.part0" { - t.Errorf("purge asked %v", p) + if p := asked[buscalls.ObjectsDelete]; p["name"] != "t1.part0" { + t.Errorf("delete and purge asked %v", p) } if p := asked[buscalls.ObjectsPut]; p["name"] != "t1.part0" || p["data"] != "aGVsbG8=" || p["description"] != "a part" { t.Errorf("put asked %v", p) diff --git a/src/state/index.ts b/src/state/index.ts index 905bf005..6cdd6a1e 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -170,11 +170,11 @@ export async function takeOnce(seat: string, ask: string, boundMs: number, state /** * Remove what the deleted object `name` left behind in the object store `objects` (by its local name), its chunks, - * through the runtime's `mesh/objects.purge` (H-A-366): the Go side's `busstate.Objects.Purge`. A bundle never opens a + * through the runtime's `mesh/objects.delete`, which purges them again when asked again (H-A-366): the Go side's `busstate.Objects.Purge`. A bundle never opens a * connection of its own for it. */ export async function purgeObject(objects: string, name: string): Promise { - await boundChannel().ask("mesh/objects.purge", { objects, name }); + await boundChannel().ask("mesh/objects.delete", { objects, name }); } /** A state this module keeps (by its local name) or reads (`.`). */ diff --git a/test/sdk.test.ts b/test/sdk.test.ts index da4a32b2..411c3363 100644 --- a/test/sdk.test.ts +++ b/test/sdk.test.ts @@ -1056,5 +1056,5 @@ async function newTest6(): Promise { const { purgeObject } = await import("../dist/state/index.js"); asked.length = 0; await purgeObject("artifacts", "pkg-1.tgz"); - assert.deepEqual(asked[0], ["mesh/objects.purge", { objects: "artifacts", name: "pkg-1.tgz" }]); + assert.deepEqual(asked[0], ["mesh/objects.delete", { objects: "artifacts", name: "pkg-1.tgz" }]); }