Set preview link expiration on creation, untangle expiration from generation timetamp

Created on 20 January 2023, almost 2 years ago
Updated 7 February 2023, almost 2 years ago

Problem/Motivation

Presently, expiration is based on the generation timestamp, plus a config value exposed in Configuration option to set default expiration limit Closed: won't fix .

This means Preview Links cannot be customised to have per-preview link expiration, and whenever the config changes, expiration is automatically applied to all preview links.

I'd like to introduce the possibility of per preview link expiration, wherein:

Expiration is set at creation. No external config changes modify pre-existing links.
Using hooks, expiration can be modified depending on custom logic.

Proposed resolution

  • Add expiration field.
  • Set default value on creation, only.
  • Migrate existing preview links, prefill data.
  • Existing expire reset button no longer resets regneration timestamp, but recalculates currentTime + expiration config, and sets it as a value.
  • When a preview link is accessed, check live expiration, rather than waiting for cron.

Remaining tasks

Implement

User interface changes

Nil

API changes

  • New expiration field methods
  • existing service internals reworked.
  • Some constructors for classes without interfaces finalised

Data model changes

New field

Feature request
Status

Fixed

Version

2.1

Component

Code

Created by

🇦🇺Australia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024