Skip to content

Release v1.3.0: async actions, phase 2 - #15

Merged
ogorzalka merged 1 commit into
mainfrom
test/async-phase-2
Oct 7, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
test/async-phase-2

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Releases Async Actions phase 2 as v1.3.0, and covers it in a real WordPress.

Real-WordPress tests (5 new, 18 in total, WP-Cron in a separate process)

  1. capture(): the trigger-time status and a request value ($_POST, sanitized) are read back at execution, beside the post reloaded in its new state.
  2. when(): a revision does not queue; the post does.
  3. unique(): two identical triggers give one event and one non-autoloaded lock; after the run the lock is gone and a new trigger queues again.
  4. asUser(): the handler runs as user 1 with that user's capabilities (current_user_can('edit_posts')). Without it, currentUser is 0 (added to the first test).
  5. tries() through WP-Cron: the retry runs on the next cron run, attempts 1 then 2.

Plus, from #12 to #14: Action Scheduler (4 tests), closures (2), fake() (1).

Release

  • CHANGELOG: [1.3.0] - 2026-10-07, with the comparison links. Under "Changed", the move of the default driver to auto (Action Scheduler when available) is highlighted, with POLLORA_ASYNC_DRIVER=wp-cron to keep the previous behaviour.
  • README: the "Asynchronous actions" section covers phase 2. It has the four rules (the fourth is now "prefer a class to a closure"), capture() and when(), the full options table, the three drivers and auto, signed closures, retries and Async::fake().

Content since v1.2.0: #9, #10, #11, #12, #13, #14. The framework suite (1,822 tests) passes with this code swapped into its vendor/ (restored afterwards).

@ogorzalka
ogorzalka merged commit 6a23672 into main Oct 7, 2026
5 checks passed
@ogorzalka
ogorzalka deleted the test/async-phase-2 branch October 7, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant