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

MacOS Monterey Support #25

Open
coolajami opened this issue Oct 27, 2021 · 18 comments
Open

MacOS Monterey Support #25

coolajami opened this issue Oct 27, 2021 · 18 comments
Assignees

Comments

@coolajami
Copy link

Hi
I've just updated MacOS on 12.0.1 version (Monterey) and I'm getting the following error:

JSON Parse Error: Unexpected token ','

The widget worked fine on MacOS 11 and I've made no other changes to the setup. I"m not sure what's going on and I'm terrible in troubleshooting code :(

@alin-simionoiuDE
Copy link

same for me. btw @coolajami, why did you use "Catalina" in the title when the comment is about Monterey? just curious

@alin-simionoiuDE
Copy link

ah here's why. pending.sh script returns, at least for me

{ "tasks": [  ], "lists": [ , , , , , ] }

this part [ , , , , , ] is not json formatted

@coolajami coolajami changed the title Catalina Support MacOS Monterey Support Oct 27, 2021
@coolajami
Copy link
Author

same for me. btw @coolajami, why did you use "Catalina" in the title when the comment is about Monterey? just curious

Lol, apologies, mistake from my part. I've updated the title.

@alin-simionoiuDE
Copy link

alin-simionoiuDE commented Oct 27, 2021

found a fix if you want to get dirty.

edit pending.sh

line 65 change from SELECT '"' || ZNAM1 || '"' to SELECT '"' || ZNAME2 || '"'

also line 85 change LIST.ZNAME1 AS list, to LIST.ZNAME2 AS list,

why would apple call these columns this way and why they stop using ZNAME1 in favor of ZNAME2 is a mystery

word of caution: once you make this change, the shell script won't work in the previous versions of MacOS. so I guess a "proper" fix would be to change the script and try both columns then use the one that has values. i chose to go quick and dirty

@coolajami
Copy link
Author

found a fix if you want to get dirty.

edit pending.sh

line 65 change from SELECT '"' || ZNAM1 || '"' to SELECT '"' || ZNAME2 || '"'

also line 85 change LIST.ZNAME1 AS list, to LIST.ZNAME2 AS list,

why would apple call these columns this way and why they stop using ZNAME1 in favor of ZNAME2 is a mystery

word of caution: once you make this change, the shell script won't work in the previous versions of MacOS. so I guess a "proper" fix would be to change the script and try both columns then use the one that has values. i chose to go quick and dirty

YES!!!IT WORKS! Thank you very much! That works fine now! I was at a loss as everything else worked, and it does not appear to be any changes to the native MacOS Reminder app. :/

@davidlday
Copy link
Owner

Oh boy - this is frustrating. Thanks for figuring out what was going on. I haven't upgrade to Monterey yet. A similar thing happened on the Catalina upgrade. I'll get this fixed and checked in, and cut a new release this weekend.

@davidlday davidlday self-assigned this Oct 28, 2021
@davidlday davidlday added the bug label Oct 28, 2021
@davidlday
Copy link
Owner

I just updated to Monterey and did not experience this issue. I'm leaving this open for now to see if anyone else has the problem. In the meantime, I'll see if I can figure out how to have the script figure out if it should use ZNAME1 or ZNAME2.

@baracude
Copy link

baracude commented Nov 1, 2021

found a fix if you want to get dirty.

edit pending.sh

line 65 change from SELECT '"' || ZNAM1 || '"' to SELECT '"' || ZNAME2 || '"'

also line 85 change LIST.ZNAME1 AS list, to LIST.ZNAME2 AS list,

why would apple call these columns this way and why they stop using ZNAME1 in favor of ZNAME2 is a mystery

word of caution: once you make this change, the shell script won't work in the previous versions of MacOS. so I guess a "proper" fix would be to change the script and try both columns then use the one that has values. i chose to go quick and dirty

When I changed pending.sh I get "bash: reminders.widget/pending.sh: /bin/bash: bad interpreter: Operation not permitted" error.
Any ideas on how to solve this?

And yes, I've set permission for Übersicht to access reminders in security and privacy setting

@alin-simionoiuDE
Copy link

what did you use as editor? the most likely explanation is that the editor you used introduced characters on save in the first line of the file that bash (the shell) doesn't like

talking about this line #!/bin/bash

if that's the case, what i would suggest is to re-download the plugin than use something like VSCode to edit the file

@baracude
Copy link

baracude commented Nov 2, 2021

what did you use as editor? the most likely explanation is that the editor you used introduced characters on save in the first line of the file that bash (the shell) doesn't like

talking about this line #!/bin/bash

if that's the case, what i would suggest is to re-download the plugin than use something like VSCode to edit the file

Thank you! I used CotEditor. Using VSCode solved the problem!

@tiziano149
Copy link

had the exact same issue, will report if I get it fixed.

JSON Parse Error: Unexpected token ','

@tiziano149
Copy link

found a fix if you want to get dirty.

edit pending.sh

line 65 change from SELECT '"' || ZNAM1 || '"' to SELECT '"' || ZNAME2 || '"'

also line 85 change LIST.ZNAME1 AS list, to LIST.ZNAME2 AS list,

why would apple call these columns this way and why they stop using ZNAME1 in favor of ZNAME2 is a mystery

word of caution: once you make this change, the shell script won't work in the previous versions of MacOS. so I guess a "proper" fix would be to change the script and try both columns then use the one that has values. i chose to go quick and dirty

this worked, though the line numbers were different. Weird...

@coolajami
Copy link
Author

Weirdly it does work for me when I've the Ubersicht but after a while, randomly gives me the following error:

Error: Error: database is locked reminders.widget/pending.sh: line 29: [: : integer expression expected Error: no such table: Z_PRIMARYKEY Error: near line 5: near ";": syntax error Error: near line 5: near "AND": syntax error { "tasks": [ ], "lists": [] }
Also I get other errors as well (where "database-name" the name of the list):

Error: Error: near line 5: database is locked { "tasks":[], "lists": ["database-name"]

When I refresh ubersicht manually, everything resets to normal. Then after a while, when it refresh itself I may get this errors.

Apart the ZNAME1/ZNAME2 replacemetn I haven't touch anything else!

@alin-simionoiuDE
Copy link

pure guess on my part, I think database is locked shows up if the script runs while reminders app is refreshing in the background. probably reminder app locks the database for a little bit. i've seen it happening, but pretty rare.

i did increase the frequency to 30 seconds so the script doesn't run that often... seems to help with the whole database lock in my case.

I will probably increase that even more. i don't care if it takes 30 seconds or a minute for a reminder to get rendered on my desktop. close enough

talking about

# Set the refresh frequency (milliseconds).
  refreshFrequency: 1000 * 30

from reminder.coffee

@coolajami
Copy link
Author

coolajami commented Nov 11, 2021

pure guess on my part, I think database is locked shows up if the script runs while reminders app is refreshing in the background. probably reminder app locks the database for a little bit. i've seen it happening, but pretty rare.

i did increase the frequency to 30 seconds so the script doesn't run that often... seems to help with the whole database lock in my case.

I will probably increase that even more. i don't care if it takes 30 seconds or a minute for a reminder to get rendered on my desktop. close enough

talking about

# Set the refresh frequency (milliseconds).
  refreshFrequency: 1000 * 30

from reminder.coffee

Thank you, that actually seem to solve the issue. LOL I actually reduced the refresh rate the last few days trying to troubleshoot the issue 🤦

@coolajami
Copy link
Author

Thank you, that actually seem to solve the issue. LOL I actually reduced the refresh rate the last few days trying to troubleshoot the issue 🤦

Unfortunately, the problem still happens! Not sure why, no I'm gettin another error in the debug console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Followed by the 'database is locked error'

🙄

@coolajami
Copy link
Author

Thank you, that actually seem to solve the issue. LOL I actually reduced the refresh rate the last few days trying to troubleshoot the issue 🤦

Unfortunately, the problem still happens! Not sure why, no I'm gettin another error in the debug console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Followed by the 'database is locked error'

🙄

I think I found a workaround to my problem above and bang my head why I haven't thought of it before.

I've unchecked the "Load bash env" in the options menu, and now the widget is stable again. I don't have a clue how this option affects the operation of the widgets, but it does seem to do the trick with the database error. Though to report it, just in case it is useful.

@hepcat72
Copy link

I just fixed my own reminders sqlite script and came here to see what other potential problems you guys may have run into that I have not yet encountered after updating to Monterey...

I have a very large reminders DB and what I am seeing is that some list names are still in ZNAME1 and others are in ZNAME2. So you have to select both and figure out which one contains the list name because I have not seen the case where the name is in both fields. In fact, there's a ZNAME3, so perhaps a more robust change would be to check all 3. This could indicate that a future change could make use of the various other 1/2/3 fields.

I'm not sure what is motivating Apple to use the different numbered fields, but one other thing I noted is that reminders now has a feature to clear old completed reminders (per list), so my hunch is that the use of 1/2/3 fields may have something to do with a rudimentary versioning? No idea really. I'm just wildly hypothesizing.

But while I'm here, I wonder if someone has some fancy SQL select function that can make the ZNAME1 or 2 determination and label it as a single column output using "AS ZNAME"?

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

No branches or pull requests

6 participants