Skip to content

feat: return WP_Error with specific refusal codes when presence write fails - #792

Merged
josephfusco merged 2 commits into
WordPress:mainfrom
huzaifaalmesbah:feat/736-refusal-reasons
Oct 9, 2026
Merged

josephfusco merged 2 commits into
WordPress:mainfrom
huzaifaalmesbah:feat/736-refusal-reasons

Conversation

@huzaifaalmesbah

@huzaifaalmesbah huzaifaalmesbah commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The REST controller and WP-CLI don't pass wp_error, since they already answer recording off (501) and a missing table (503) before writing, so the argument is for callers outside the plugin such as an awareness backend, and with it off every existing false check behaves as before.

Fixes #736

Use of AI Tools

AI assistance: Yes
Tool(s): Google Antigravity, Claude Code
Model(s): Gemini 3.8 Flash, Claude Opus 5.5
Used for: The first draft (Gemini); rebuilding it on #789's $args, the tests and the README (Claude); reviewed and run locally by me.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props huzaifaalmesbah, joefusco.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🛝 WordPress Playgrounds

Built from fbb556e

Post locks RTC Synced patterns Settings
Single site Launch post locks, single site Launch RTC, single site Launch synced patterns, single site Launch settings, single site
Multisite Launch post locks, multisite Launch RTC, multisite Launch synced patterns, multisite Launch network settings, multisite

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.94%. Comparing base (ea6bcfb) to head (fbb556e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #792      +/-   ##
============================================
+ Coverage     94.93%   94.94%   +0.01%     
  Complexity      268      268              
============================================
  Files            30       30              
  Lines          4123     4137      +14     
============================================
+ Hits           3914     3928      +14     
  Misses          209      209              
Flag Coverage Δ
multisite 94.94% <100.00%> (+0.01%) ⬆️
phpunit 74.40% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@huzaifaalmesbah
huzaifaalmesbah marked this pull request as draft October 8, 2026 16:35
@huzaifaalmesbah huzaifaalmesbah mentioned this pull request Oct 8, 2026
1 of 4 tasks
@huzaifaalmesbah
huzaifaalmesbah force-pushed the feat/736-refusal-reasons branch from 2d9293d to 1058be7 Compare October 8, 2026 19:12
github-actions Bot added a commit that referenced this pull request Oct 8, 2026
@huzaifaalmesbah
huzaifaalmesbah marked this pull request as ready for review October 8, 2026 19:17
@josephfusco

Copy link
Copy Markdown
Collaborator

0.17.0 shipped before this landed, so the two @since 0.17.0 Added the wp_error argument lines should say 0.18.0.

@huzaifaalmesbah

Copy link
Copy Markdown
Member Author

Done in fbb556e.

github-actions Bot added a commit that referenced this pull request Oct 8, 2026

@josephfusco josephfusco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks for adding!

@josephfusco
josephfusco merged commit fbca40d into WordPress:main Oct 9, 2026
25 checks passed
@github-actions github-actions Bot added this to the 0.18.0 milestone Oct 9, 2026
@josephfusco josephfusco added [Type] Enhancement A suggestion for improvement of an existing feature [Area] Database Issues for the wp_presence table and cron cleanup Public API Adds a hook, route, constant, or global that third parties can depend on php Pull requests that update php code labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Database Issues for the wp_presence table and cron cleanup php Pull requests that update php code Public API Adds a hook, route, constant, or global that third parties can depend on [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Say why a presence write was refused

2 participants