Skip to content

Make ephemeral option policy configurable for durable cron #140

Description

@chubes4

Problem

Markdown Database Integration currently treats the exact cron option as unconditionally ephemeral in WP_Markdown_Write_Engine::EPHEMERAL_OPTION_NAMES.

That is correct for request-driven WordPress runtimes that cannot execute background work, but it prevents runtimes with an explicit durable scheduler from preserving WordPress cron events. wp_schedule_single_event() succeeds in the active runtime, then the cron option is omitted from canonical storage and the event disappears after reconstruction.

Reproduction

  1. Boot MDI primary mode from canonical Markdown/JSON state.
  2. Call wp_schedule_single_event( time() - 1, 'example_hook', array(), true ) and flush canonical writes.
  3. Reconstruct the runtime from canonical state.
  4. wp_next_scheduled( 'example_hook' ) returns false.

The downstream Cloudflare scheduled-Worker gate proved this with a real plugin callback and reconstructed runtime.

Proposed contract

Make the exact ephemeral option-name policy filterable while retaining the current defaults. A runtime with a durable scheduler can remove cron from the ephemeral-name list; transients, doing_cron, and all existing behavior remain unchanged by default.

Suggested filter shape:

$names = apply_filters( 'markdown_database_integration_ephemeral_option_names', self::EPHEMERAL_OPTION_NAMES );

The owning layer should validate/filter the resulting list and include deterministic tests for:

  • unchanged default cron ephemerality;
  • opting cron into canonical option persistence;
  • reconstructed scheduled-event visibility;
  • malformed filter output failing safely or reverting to defaults.

Downstream tracker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions