Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark As Done failing silently when the Tasks plugin is active #22

Closed
muness opened this issue Dec 26, 2023 · 20 comments · Fixed by #34
Closed

Mark As Done failing silently when the Tasks plugin is active #22

muness opened this issue Dec 26, 2023 · 20 comments · Fixed by #34
Assignees
Labels
enhancement New feature or request

Comments

@muness
Copy link
Member

muness commented Dec 26, 2023

In #18 (comment), @judisohn reported that Amazing Marvin tasks don't get marked as done, even when the feature is enabled in settings.

Update: per @judisohn's investigation, we think this is a conflict with some other task-related plugin behavior. I'll keep this open until we can figure out the conflict and then I'll try to make this plugin compatible.

@muness
Copy link
Member Author

muness commented Dec 26, 2023

I haven't been able to reproduce this issue, @judisohn . Can you try again and include anything I might be able to use to replicate the problem?

@muness muness added the bug Something isn't working label Dec 26, 2023
@muness muness mentioned this issue Dec 26, 2023
4 tasks
@judisohn
Copy link

I see you've made some other commits... how about I try again with an updated version once you have a new release .zip and see if I'm still struggling here? I can record a video for you if it's still a problem.

@muness
Copy link
Member Author

muness commented Dec 26, 2023

Thanks @judisohn , that would be great!

@muness
Copy link
Member Author

muness commented Dec 26, 2023

@judisohn
Copy link

Unfortunately. This is still failing for me (although the Local Server option is persisting correctly).

Now when I create a task it's scheduling for a day in advance instead of today.

Here's a screen shot of my entry in Obsidian:

CleanShot 2023-12-26 at 18 04 36@2x

But it's creating the task with a scheduled date of 12/27 instead of today, 12/26:

CleanShot 2023-12-26 at 18 04 58@2x

CleanShot 2023-12-26 at 18 05 33@2x

And when I complete it in Obsidian, nothing happens. Nothing in the developer console. Only updates I see are from the List Modified Plugin.

CleanShot 2023-12-26 at 18 06 18@2x

I did also get some errors trying above for Failed to load resource: the server responded with a status of 429 running the create command originally. But then when I tried again the modal came up.

Let me know if there's a better way to get you more useful logs.

@muness
Copy link
Member Author

muness commented Dec 26, 2023

Only updates I see are from the List Modified Plugin.

My guess is that it's preventing my own handler that watches for the task to be checked as I only look for the [ ] to turn into a [x] and because it adds a bunch of text, that's now broken.

Mind disabling it and trying again?

@muness
Copy link
Member Author

muness commented Dec 26, 2023

As for the erroneous Scheduled date, I suspect a timzone offset issue: the public AM server runs UTC. I do no handling whatsover of the +today and rely on AM to parse it. I do send the timezone offset of the machine so it should work.

I can replicate this, will see if my timezoneoffset is incorrect and fix that.

@muness
Copy link
Member Author

muness commented Dec 26, 2023

As for the erroneous Scheduled date, I suspect a timzone offset issue: the public AM server runs UTC. I do no handling whatsover of the +today and rely on AM to parse it. I do send the timezone offset of the machine so it should work.

I can replicate this, will see if my timezoneoffset is incorrect and fix that.

The offset being sent in ET is +300. Looks like this should be -300. Per the docs:

// Added to time to fix time zone issues.  So if the user is in Pacific time,
// this would be -8*60. 

@judisohn
Copy link

My guess is that it's preventing my own handler that watches for the task to be checked as I only look for the [ ] to turn into a [x] and because it adds a bunch of text, that's now broken.

Mind disabling it and trying again?

Disabled it and tried again. When I complete a task absolutely nothing happens and there's nothing in the Dev Console. I verified that I have the local API enabled in my desktop copy and it's the same port.

@judisohn
Copy link

judisohn commented Dec 26, 2023

I thought for a moment that perhaps the Tasks plugin was conflicting, so I tried disabling it. Following that, I can't get your plug-in to behave at all. I get the create modal, but this error on save every time. Rate limiting? Which is supposed to be avoided with local server, no?

CleanShot 2023-12-26 at 18 52 16@2x

@muness
Copy link
Member Author

muness commented Dec 27, 2023

I thought for a moment that perhaps the Tasks plugin was conflicting, so I tried disabling it. Following that, I can't get your plug-in to behave at all. I get the create modal, but this error on save every time. Rate limiting? Which is supposed to be avoided with local server, no?

This is Amazing Marvin rate limiting the requests, exactly. I've been hitting it a lot, which is why I tried the local server path, only to discover most endpoints aren't available on it. If you wait a few minutes it should start working again.

I've contacted support about this throttling. I'd be happy to run a local server to avoid overloading the public server, but that doesn't really work when only a few API endpoints are implemented.

@muness
Copy link
Member Author

muness commented Dec 27, 2023

Timezone offset reversal done in #31 . Released in the new beta, https://github.com/cloud-atlas-ai/obsidian-am/releases/tag/0.5.0b4

@muness
Copy link
Member Author

muness commented Dec 27, 2023

When I complete a task absolutely nothing happens and there's nothing in the Dev Console.

https://github.com/cloud-atlas-ai/obsidian-am/blob/master/src/main.ts#L246-L257 when the API call fails, I throw an error and puts a notice and a message in the dev console.

If you aren't seeing anything, that means the matcher isn't seeing the check off behavior. What checklist related plugins do you have installed? I am guessing one or more of them are changing the signature expected at https://github.com/cloud-atlas-ai/obsidian-am/blob/master/src/amTaskWatcher.ts#L22-L29

@judisohn
Copy link

To be sure, I created a brand new vault with nothing enabled but Amazing Marvin. it's behaving just fine there which is great.

So now I guess I need to try again disabling my existing plugins one at a time until I figure out the culprit - or I hit the rate limit again. Whichever comes first. :-) I'll give it a go tomorrow or later in the week.

@muness
Copy link
Member Author

muness commented Dec 27, 2023

To be sure, I created a brand new vault with nothing enabled but Amazing Marvin. it's behaving just fine there which is great.

Thanks for confirming! I thought I had pulled off an "it works for me" somehow. ;)

So now I guess I need to try again disabling my existing plugins one at a time until I figure out the culprit - or I hit the rate limit again. Whichever comes first. :-) I'll give it a go tomorrow or later in the week.

Let me know which plugin you hone in on (or setting for a plugin). I can probably find a way to be compatible with it once we figure out what's causing the conflict.

@muness muness changed the title Mark As Done failing silently Mark As Done failing silently when some other task plugin (TBD) is active Dec 27, 2023
@muness muness removed the bug Something isn't working label Dec 27, 2023
@judisohn
Copy link

@muness Had a little time to test this morning.

Not sure what happened yesterday but I can confirm now without a shadow of a doubt the problem is indeed the Tasks Plugin. With it disabled the task completes just fine. With it enabled and nothing else different, the message to complete the task is never sent. It makes sense, because Tasks does have some popups and post-complete activities that is likely in the way.

This plugin is insanely popular with nearly 900K downloads so working with it should probably be a priority. Chances are I'm not the only one who would want to use both.

Let me know if there's anything else I can test for you.

@muness
Copy link
Member Author

muness commented Dec 27, 2023

Thank you for the testing! I'll give it a try and see if I can figure out how to be compatible with it.

@muness muness changed the title Mark As Done failing silently when some other task plugin (TBD) is active Mark As Done failing silently when the Tasks plugin is active Dec 27, 2023
@muness muness self-assigned this Dec 27, 2023
@muness muness added the enhancement New feature or request label Dec 27, 2023
@muness
Copy link
Member Author

muness commented Dec 27, 2023

When using Tasks Plugin and allowing it to update other elements, the logic doesn't match the toggle
image

          if (change.length === 1 && (change.sliceString(0, 1) === "X" || change.sliceString(0, 1) === "x")) {

I'll relax the logic to allow a match, which should work.

@muness
Copy link
Member Author

muness commented Dec 27, 2023

@judisohn , would you give the latest release a try to make sure it fixes this issue for you? Thanks! https://github.com/cloud-atlas-ai/obsidian-am/releases/tag/0.5.1

@judisohn
Copy link

Woo hoo @muness it works!!! But I found a new issue which I'll start separately with the link back Advanced URI... sooo close. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants