Data should literally be like wp_postmeta which has the columns:
meta_id
post_id
use something like asana_obj_id or resource_id
use type string instead of bigint per Asana's GID schema
meta_key
meta_value
_We could also add Asana's resource_type field, but that doesn't really help anything outside of debugging._
Table name probably just {prefix}asana_resource_meta or simply {prefix}asana_meta. The kicker is that this is for storing local metadata to WordPress in relation to remote Asana resources.
Also, how do we purge meta records? Here's some immediate thoughts:
Webhook to listen for resource deletion
Cron to check resources for deletion or other inaccessibility
"deletion" is an unclear term because Asana resources can be recovered from a deleted state
last_accessed field with Cron to purge stale data
This is risky because this data cannot be recovered and is owned purely by the WordPress system
The Asana authentication user's permissions can change which resources are actually accessible, but typically the Frontend Authentication User is going to be responsible for displaying the data. However, that setting may change, the Asana user's permissions may change, etc. which means nothing can really be inferred from the data's current accessibility.
Is there a way, regardless of the user's permissions, to tell if a resource has been permanently deleted? Are those recoverable? I imagine that's the difference between a regular Delete and a Permanently Delete action, but... maybe Asana Business users have a different experience..?
No immediate initiative in Completionist Free, but the Pro version will use this data for its new features. See https://github.com/PurpleTurtleCreative/completionist-pro/issues/1
Data should literally be like
wp_postmeta
which has the columns:meta_id
post_id
asana_obj_id
orresource_id
meta_key
meta_value
_We could also add Asana's
resource_type
field, but that doesn't really help anything outside of debugging._Table name probably just
{prefix}asana_resource_meta
or simply{prefix}asana_meta
. The kicker is that this is for storing local metadata to WordPress in relation to remote Asana resources.Also, how do we purge meta records? Here's some immediate thoughts:
last_accessed
field with Cron to purge stale dataThe Asana authentication user's permissions can change which resources are actually accessible, but typically the Frontend Authentication User is going to be responsible for displaying the data. However, that setting may change, the Asana user's permissions may change, etc. which means nothing can really be inferred from the data's current accessibility.
Is there a way, regardless of the user's permissions, to tell if a resource has been permanently deleted? Are those recoverable? I imagine that's the difference between a regular Delete and a Permanently Delete action, but... maybe Asana Business users have a different experience..?![Screenshot 2024-01-07 at 9 45 28 PM](https://github.com/PurpleTurtleCreative/completionist/assets/33374343/f5e3bfd2-2dfa-4675-911b-452738743a1e)