@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-tasks/>
  a sioc:Post ;
  dc:title "Progress log storage" ;
  dcterms:identifier 154917 ;
  dc:modified "2026-11-17T20:56:46Z"^^xsd:dateTime ;
  dc:created "2026-11-17T16:53:16Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-tasks/progress-log-storage/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded "<ul class=\"lh_portfolio-meta\"><li><strong>Part of:</strong> <a href=\"https://lhero.org/portfolio/lh-tasks/\">LH Tasks</a></li></ul><p class=\"wp-block-paragraph\">Since 1.30.0 (#151741) a task&#8217;s progress log is stored as comments of type <code>lh_task_log</code>, one per entry, instead of one serialized <code>_lh_tasks-progress_log</code> post meta array. Every append to the array read the whole log and saved it back, so two entries written at the same moment (a heartbeat and a note, say) could drop one. Each entry is now its own row. <code>LH_Tasks_progress_log_class</code> (<code>includes/lh-tasks-progress-log-class.php</code>) owns the storage.</p><h3 class=\"wp-block-heading\">Shape</h3><ul class=\"wp-block-list\"><li>The comment&#8217;s post is the task, its user is the actor (0 for the system), its date is the entry&#8217;s time (site local, with the GMT date alongside) and its content is the note, which may be empty. Always approved.</li><li>The event and every other key of the entry (<code>from_status</code>, <code>to_status</code>, <code>fields</code>, <code>via</code> and so on) are comment meta named <code>_lh_tasks-log-{key}</code>, for example <code>_lh_tasks-log-event</code>.</li><li>Callers are unchanged: <code>LH_Tasks_task_actions_class::append_progress_log( $post_id, $entry )</code> writes and now returns the new entry&#8217;s ID (or false). <code>LH_Tasks_task_actions_class::get_progress_log( $post_id )</code> is the one reader, used by <code>get-task</code>, <code>list-tasks</code>, the task page and follow-ups. It returns the same entry shape as before, oldest first, plus <code>log_id</code>: the entry&#8217;s own ID.</li><li>Each append purges the task page from LiteSpeed (<code>litespeed_purge_post</code>) and fires <code>lh_tasks_progress_log_appended</code> (<code>$post_id, $log_id</code>).</li></ul><h3 class=\"wp-block-heading\">Kept internal</h3><p class=\"wp-block-paragraph\">Entries are inserted directly into the comments table, not through <code>wp_insert_comment()</code>, so nothing that listens for new comments sees them. Enable Mastodon Apps mirrors every approved comment into a published post (fix proposed upstream as akirk/enable-mastodon-apps#360), and ActivityPub and BuddyPress record comment activity. No comment notifications or spam checks run. Log comments are also left out of:</p><ul class=\"wp-block-list\"><li>comment queries that don&#8217;t ask for the type by name: the Comments screen, comment lists, the Recent Comments widget and block, the dashboard (<code>comments_clauses</code>);</li><li>comment feeds (<code>comment_feed_where</code>);</li><li>comment counts, for the site and for a task (<code>wp_count_comments</code>, subtracting from whatever other plugins returned, and <code>pre_wp_update_comment_count_now</code>);</li><li>the REST comments endpoint, lists and single comments alike, even when the type is asked for (<code>rest_comment_query</code>, <code>rest_request_before_callbacks</code>). Core would otherwise let anyone who can read a task, such as its assignee, read its log there.</li></ul><h3 class=\"wp-block-heading\">Migration (1.30.0, removed in 1.30.1)</h3><p class=\"wp-block-paragraph\">1.30.0 moved every existing log across on <code>init</code>, a batch of tasks per request, keeping each entry&#8217;s time and actor, and deleted each task&#8217;s old meta once all its entries were verified. Every site had finished within minutes, with no failures, so 1.30.1 (#154918) removed the migration and the reader&#8217;s fallback to the old meta. Migrated entries still carry <code>_lh_tasks-log-legacy_index</code> (their position in the old array); the reader hides it. The options <code>lh_tasks_progress_log_comments_migrated</code> left on each site are no longer read.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH TasksSince 1.30.0 (#151741) a task&#8217;s progress log is stored as comments of type lh_task_log, one per entry, instead of one serialized _lh_tasks-progress_log post meta array. Every append to the array read the whole log and saved it back, so two entries written at the same moment (a heartbeat and a note, say) could drop one. Each entry is now its own row. LH_Tasks_progress_log_class (includes/lh-tasks-progress-log-class.php) owns the storage.ShapeThe comment&#8217;s post is the task, its user is the actor (0 for the system), its date is the entry&#8217;s time (site local, with the GMT date alongside) and its content is the note, which may be empty. Always approved.The event and every other key of the entry (from_status, to_status, fields, via and so on) are comment meta named _lh_tasks-log-{key}, for example _lh_tasks-log-event.Callers are unchanged: LH_Tasks_task_actions_class::append_progress_log( $post_id, $entry ) writes and now returns the new entry&#8217;s ID (or false). LH_Tasks_task_actions_class::get_progress_log( $post_id ) is the one reader, used by get-task, list-tasks, the task page and follow-ups. It returns the same entry shape as before, oldest first, plus log_id: the entry&#8217;s own ID.Each append purges the task page from LiteSpeed (litespeed_purge_post) and fires lh_tasks_progress_log_appended ($post_id, $log_id).Kept internalEntries are inserted directly into the comments table, not through wp_insert_comment(), so nothing that listens for new comments sees them. Enable Mastodon Apps mirrors every approved comment into a published post (fix proposed upstream as akirk/enable-mastodon-apps#360), and ActivityPub and BuddyPress record comment activity. No comment notifications or spam checks run. Log comments are also left out of:comment queries that don&#8217;t ask for the type by name: the Comments screen, comment lists, the Recent Comments widget and block, the dashboard (comments_clauses);comment feeds (comment_feed_where);comment counts, for the site and for a task (wp_count_comments, subtracting from whatever other plugins returned, and pre_wp_update_comment_count_now);the REST comments endpoint, lists and single comments alike, even when the type is asked for (rest_comment_query, rest_request_before_callbacks). Core would otherwise let anyone who can read a task, such as its assignee, read its log there.Migration (1.30.0, removed in 1.30.1)1.30.0 moved every existing log across on init, a batch of tasks per request, keeping each entry&#8217;s time and actor, and deleted each task&#8217;s old meta once all its entries were verified. Every site had finished within minutes, with no failures, so 1.30.1 (#154918) removed the migration and the reader&#8217;s fallback to the old meta. Migrated entries still carry _lh_tasks-log-legacy_index (their position in the old array); the reader hides it. The options lh_tasks_progress_log_comments_migrated left on each site are no longer read." ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
