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

Difficulties with deploying the plugin #29

Closed
jtof-dev opened this issue Dec 4, 2023 · 11 comments · Fixed by #32
Closed

Difficulties with deploying the plugin #29

jtof-dev opened this issue Dec 4, 2023 · 11 comments · Fixed by #32

Comments

@jtof-dev
Copy link

jtof-dev commented Dec 4, 2023

Hey! I followed your instructions from the README.md and from this issue, but I still haven't had any luck with getting the plugin to work. I have filled out all the sections in both the gist and local saving sections, but can't get either to update. I have filled out every section in both the gist and local sections. Here are the tasks I am trying to get recognized (in a To Do.md file):

- [ ] #task 2023-12-04 work on stuff

- [ ] 2023-12-05 tasks

I am running Obsidian on Macos 14. What other information do I need to provide?

Screenshot 2023-12-04 at 11 42 06 AM

One interesting note is that every time I paste in my github personal access key, the field gets cleared. I'm not sure if this is intentional or part of the problem.

@bepolymathe
Copy link

One interesting note is that every time I paste in my github personal access key, the field gets cleared. I'm not sure if this is intentional or part of the problem.

For info. I just made a test yesterday... same behavior.

@jtof-dev
Copy link
Author

jtof-dev commented Dec 4, 2023

I figured that my problem was that I was manually making tasks instead of using the official Obsidian Tasks plugin with due dates and scheduled dates etc, but still no dice.

@bepolymathe
Copy link

I figured that my problem was that I was manually making tasks instead of using the official Obsidian Tasks plugin with due dates and scheduled dates etc, but still no dice.

Did you include emoji before date ? 

@jtof-dev
Copy link
Author

jtof-dev commented Dec 4, 2023

Yes, I have migrated over to using the standard Tasks format with emojis and dates now. (Don't know how it took me this long to find out about Tasks)

@andrewbrereton
Copy link
Owner

Hi @JJTofflemire, thanks for raising this issue.

- [ ] #task 2023-12-04 work on stuff
- [ ] 2023-12-05 tasks

This should absolutely be identified as a Task. The regular expression to find a date in a line is:

/(?<emoji>➕|⏳|🛫|📅|✅)?\s?(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{1,2})\b/gi

The <emoji> group is optional. A long as there is a "0000-00-00" or "0000-00-0" where 0 is any number, then it should be considered a date and therefore a valid task with a date.

In my test case I have:

image

And in the console I can see it was identified correctly:

image

So then I added your test case:

image

And it worked 😳:

image

I'm at a loss trying to understand how this could happen. I've added some additional logging and a new setting called "Debug mode" to print more logs to console. Perhaps that will assist me in working out what is going on here.

@jtof-dev
Copy link
Author

jtof-dev commented Dec 6, 2023

That's really weird. I configured the plugin on my desktop running Arch Linux, and still no dice. Here's the output from Debug Mode.

image

Which failed to find these tasks:

- [ ] Module 1 and 2 review 📅 2023-12-08 ⏳ 2023-12-07 
- [ ] Section 17.2 # 1, 5, 15 p 979 🔼 ⏳ 2023-12-05
- [ ] Webwork Set 23 (4 problems) ⏫ ⏳ 2023-12-05 📅 2023-12-06
- [ ] Homework 11 📅 2023-12-11 ⏬ 

The link from the iCal settings successfully pulls up my gist, though there is still an error in the console. Also, when I tried to enter my Github token, every time I tried to type in the box it would immediately deselect (and pasting in the token would give me no feedback). Though, regardless, the primary issue appears to be identifying the tasks.

@andrewbrereton
Copy link
Owner

I'm wondering about the GitHub token. Can you confirm the details of the token?

I currently enforce the token to be either a classic token or a fine-grained token like this:

^ghp_[a-zA-Z0-9]{255}$

or

^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$

Can you check if your token looks like this or if it looks different? If it's different, then the code will throw an error. That would explain the token being cleared, and maybe even the plugin not working correctly from there on.

@jtof-dev
Copy link
Author

jtof-dev commented Dec 6, 2023

Yes, that was the problem! I switched to a fine-grained access token, and now the plugin works as intended (both writing to a gist and to a .ical file locally). My classic token was only 40 characters long, which was causing all the problems. I'm not sure if I was failing to copy the whole token or if they are not always 255 characters long

@andrewbrereton
Copy link
Owner

That's great to hear. I will update the code to be a bit better about what should happen when there is a problem parsing the token. eg: Tell the user instead of simply clearing the textbox.

andrewbrereton added a commit that referenced this issue Dec 6, 2023
…ow an error message to the user when validation fails.
andrewbrereton added a commit that referenced this issue Dec 6, 2023
…lidation

Fixes #29. Improve regex to detect valid or invalid GitHub tokens
@andrewbrereton
Copy link
Owner

This has been fixed in 1.9.1

@bepolymathe
Copy link

I confirm it works for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants