openvibers/openvibe.mediahub Commits

Pics: deleting says what happens at the edge (#65)

OP OpenVibers committed 29 days ago · 2f0b92c066 · 1 file, +2 −2

The direct link is cached for ten minutes (s-maxage=600), so a deleted picture's file can still load for up to ten minutes where it was embedded; the page went at once. The production probe on 2026-10-15 saw exactly that. The delete button and the confirmation now say so instead of 'its links stop working at once'.

Changes

ddiff --git a/server/pics/pages.js b/server/pics/pages.js
iindex d87fd87..98c4ea2 100644
---- a/server/pics/pages.js
++++ b/server/pics/pages.js
@@@ -266,7 +266,7 @@ ${owner ? html`<section class="ovp-section ovp-owner" aria-labelledby="h-yours">
<input name="new_title" type="text" maxlength="120" placeholder="New album name" aria-label="New album name">
<button class="ovp-btn" type="submit">Add</button></form>
${holding.length ? html`<p class="muted">In ${holding.map((a, i) => html`${i ? ', ' : ''}<a href="/a/${a.slug}">${a.title}</a>`)}.</p>` : ''}
--<form class="ovp-form ovp-inline" method="post" action="/i/${row.slug}/delete" data-confirm="Delete this picture for good?"><button class="ovp-btn ovp-btn--danger" type="submit">Delete this picture</button> <span class="muted">Its links stop working at once.</span></form>
++<form class="ovp-form ovp-inline" method="post" action="/i/${row.slug}/delete" data-confirm="Delete this picture for good?"><button class="ovp-btn ovp-btn--danger" type="submit">Delete this picture</button> <span class="muted">Its page goes at once; copies other sites already loaded can show for up to ten minutes.</span></form>
</section>` : ''}
${!owner && !hidden ? html`<details class="ovp-report"><summary>Report this picture</summary>
<form class="ovp-form" method="post" action="/i/${row.slug}/report">
@@@ -322,7 +322,7 @@ ${pics.REASONS.map((r) => html`<label class="ovp-radio"><input type="radio" name
const byKey = row && pics.deleteKeyMatches(row, String(req.body.key || ''));
if (!row || !(pics.isOwner(row, whoOf(req)) || byKey)) return notFound(req, res);
await pics.remove(row);
-- return page(req, res, { title: 'Deleted', body: html`<h1>Deleted</h1><p>The picture and its links are gone.</p><p><a class="ovp-btn ovp-btn--primary" href="/">Upload another</a>${signedIn(req) ? html` <a class="ovp-btn" href="/mine">Your pictures</a>` : ''}</p>` });
++ return page(req, res, { title: 'Deleted', body: html`<h1>Deleted</h1><p>The picture is gone. Places that already showed it may keep a copy for up to ten minutes.</p><p><a class="ovp-btn ovp-btn--primary" href="/">Upload another</a>${signedIn(req) ? html` <a class="ovp-btn" href="/mine">Your pictures</a>` : ''}</p>` });
});
// The delete link a signed-out uploader keeps: a page with one button (a GET never deletes).