RTC: Use transients for awareness state (KISS approach).#11119
RTC: Use transients for awareness state (KISS approach).#11119peterwilsoncc wants to merge 6 commits intoWordPress:trunkfrom
Conversation
f310624 to
6ce6546
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| // update_post_meta returns false if the value is the same as the existing value. | ||
| update_post_meta( $post_id, self::AWARENESS_META_KEY, $awareness ); | ||
| // set_transient() can return false if the value is the same as the existing value, which is considered a success regardless. | ||
| set_transient( $this->get_awareness_transient_key( $post_id ), $awareness, HOUR_IN_SECONDS ); |
There was a problem hiding this comment.
What this doesn't still address is the issue of the race condition, yeah? Consider the case where two clients attempt to update the same post meta at the same time. As I understand, this is where #11068 would still be advantageous.
Trac ticket: https://core.trac.wordpress.org/ticket/64696
Use of AI Tools
Nil. Nada. Null.