PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
1 stars 0 forks source link

Handle deleting an Asana task that was already deleted in Asana #167

Closed MichelleBlanchette closed 11 months ago

MichelleBlanchette commented 1 year ago

Steps to Recreate

  1. Load the Dashboard Widget
  2. Go into Asana and delete one of the tasks displayed in the Dashboard Widget
  3. Back in WordPress, try deleting the task you just deleted in Asana

An error notice should be displayed which says:

Error 0. Not Found

Desired Behavior

Simply proceed with removing the task since it is already gone (HTTP 404). Kinda weird, though, that Asana doesn't just return an HTTP 200 code since the task is actually valid and simply archived, but I can understand.

Screenshot 2023-08-11 at 9 30 17 PM

MichelleBlanchette commented 11 months ago

I actually don't think you can make this assumption because a Not Found error could also mean that the user lost view access to that task. That doesn't mean that it was actually deleted.

However, if you want to simply ignore that error and let the task be visually removed from the widget, that makes sense as the user no longer has access to that task anyways. This still sounds like a possibly risky assumption, though, so I'd rather the user simply refresh the page entirely to fix the widget's state rather than maintain (possibly incorrect) code for this edge case.