Implement response deletes in the browser host instead of declining them

"Delete all responses" and "Clear send history" were in the web host's
DECLINED table under "Sending isn't available in the browser yet". That
conflated producing responses with deleting responses the user already
has: both are pure database work, and the model layer in the worker
already answers that class of command.

Both dispatch arms call the same yaak-models queries
yaak_commands::models does, so the cascade and the delete events match
the desktop's.
This commit is contained in:
Gregory Schier
2026-08-17 07:47:14 -07:00
parent 2d2a390bfd
commit 366831df5b
4 changed files with 38 additions and 8 deletions
+6 -4
View File
@@ -66,6 +66,12 @@ const HANDLERS: Partial<Record<AppCmd, Handler>> = {
models_websocket_events: (payload, db) => db.rpc("models_websocket_events", payload),
cmd_get_workspace_meta: (payload, db) => db.rpc("cmd_get_workspace_meta", payload),
// Deleting responses (and clearing send history) is database work, not a
// send: it removes rows the user already has. The model layer in the worker
// answers these with the same queries the desktop uses, cascade and all.
cmd_delete_all_http_responses: (payload, db) => db.rpc("cmd_delete_all_http_responses", payload),
cmd_delete_send_history: (payload, db) => db.rpc("cmd_delete_send_history", payload),
/* -------------------------------- app ---------------------------------- */
async cmd_metadata() {
@@ -298,10 +304,6 @@ const DECLINED: Partial<Record<AppCmd, [reason: string, capability: CapabilityNa
cmd_call_folder_action: ["Plugins aren't available in the browser yet", "plugins"],
cmd_call_http_authentication_action: ["Plugins aren't available in the browser yet", "plugins"],
// Sending history and its bookkeeping belong to the send slice.
cmd_delete_send_history: ["Sending isn't available in the browser yet", null],
cmd_delete_all_http_responses: ["Sending isn't available in the browser yet", null],
cmd_send_feedback: ["Feedback goes through the desktop app for now", null],
};