-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
task export
incorrectly formats numeric values if they are not actually numeric
#3330
Comments
that explains that one somewhat.
|
OK. The issue was a value there with |
Also: I am thinking my issues with |
The That said, we can try to fix the parser if it's buggy, or needs to be more lenient in what it accepts. Could you provide a redacted, reduced version of the JSON file that caused this error? That reminds me, my own import failed on some invalid Unicode encoding in the exported JSON. #3333 tracks that. |
There's a decent amount of personal info spread throughout the JSON and I wouldn't be so confident I'd managed to strip it all out. However, I can share the offending line, given I fixed it and it tells me exactly where it is:
As mentioned above, the issue seems to be |
I'm guessing maybe it would expect letters like that to be eg. |
Yeah, a bare
When you say you "do not use" that, what does that mean? |
I mean that I don't use the default priority UDAs. That one probably made it through the cracks somehow, maybe when I changed over to my current UDAs I ran the command only on pending tasks or a specific context or something. Instead, I have:
Before upgrading these were floats:
but it would display the floats as not-floats in my reports and assign the urgency correctly. Not sure why it changed, but it doesn't seem very important given stuff works. |
Oh, interesting! Indeed, if I add a task with a default [
{"id":1,"description":"foo","entry":"20240405T013424Z","modified":"20240405T013424Z","priority":"M","status":"pending","uuid":"dc75a11d-afcf-45d2-9fde-21e4fe52e85e","urgency":3.9}
] But once I add that UDA configuration, TW assumes that the priority is numeric and produces invalid JSON: [
{"id":1,"description":"foo","entry":"20240405T013424Z","modified":"20240405T013424Z","priority":M,"status":"pending","uuid":"dc75a11d-afcf-45d2-9fde-21e4fe52e85e","urgency":3.9}
] So that's definitely a bug in |
task export
incorrectly formats numeric values if they are not actually numeric
I'm honestly not sure what TW should do -- with a definition of @tbabej, any guidance here? |
Even if we fix the export formatting here, the fact that the field contains unexpected value type remains, and would likely cause problem (or silent bugs) in things that involve that attribute - i.e. in this case, if urgency is being calculated. I guess we should not completely error out, but any invalid attributes should be regarded as not set, and should emit warnings to the user. Am I correct in assuming that manual DB edits in the current model could be prevented by the user running simply |
I think I think the issue here is that
It sounds like you're suggesting the second option? |
The basic process and the error message is thus:
Output of
task diag
:So... I see in another git issue here that it was surprising Arch was upgrading people with no warning. It seems that, actually, something else is going on?
I note that the PKBUILD in the Arch /extra/ repository looks fine to me: https://gitlab.archlinux.org/archlinux/packaging/packages/task/-/blob/main/PKGBUILD?ref_type=heads
So I am not sure what is up here!
I also don't know if this is actually the cause of my issue - it could be something entirely unrelated to the upgrade. I mean, if I am indeed on 2.6.2, import should work as expected for 2.6.2!
My package manager upgraded me without me being aware of breaking changes. So I was actually on whatever the Arch repositories says is 3.0.0 for a while. I didn't notice any breakages whatsoever. Given it seems that 3.0.0 is actually 2.6.2 here, that is probably why...
Current plan of action: build task 3.0.0 myself, and see if task import works without a hitch.
The question I have in case it doesn't, I guess, would be if there's some obvious regex to someone familiar with the relevant .json structure I can run to catch any breakages in the .json. Probably it would be easy to spot with a small file, but I have just shy of 5,000 lines.
Thank you for your work!
The text was updated successfully, but these errors were encountered: