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

Taskd tx.data file invalid after modifying task with dependencies in Foreground #162

Open
me-and opened this issue Jun 16, 2023 · 1 comment

Comments

@me-and
Copy link

me-and commented Jun 16, 2023

If I have a task that has dependencies, and I complete the task using Foreground, my other Taskwarrior clients stop being able to sync to my taskd server, and instead start reporting "Unrecognized Taskwarrior file format or blank line in data."

Looking at the tx.data file, I see the following (whitespace added for clarity):

{
  "description":"test2",
  "uuid":"73ecca6c-f6c2-4abb-ad35-80a5a8884eba",
  "project":"",
  "status":"completed",
  "priority":"",
  "modified":"20230616T214045Z",
  "end":"20230616T214045Z",
  "entry":"20230616T213531Z",
  "tags":["inbox"],
  "annotations":[],
  "depends":"[\"dcc67934-6230-46e2-aa04-846d31efd329\"]"
}

Note the depends entry; that should be "depends":["dcc67934-6230-446e2-aa04-846d31efd329"].

The above test case was created with the following (the inbox tagging is a custom hook I have):

$ taskd add user adam test
New user key: e65cfbf7-9183-424b-8d54-46798c3afe76
Created user 'test' for organization 'adam'

$ TASKDATA=/tmp/task task rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76 add test
TASKDATA override: /tmp/task
Created task 1.
Configuration override rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76
Tagged test as inbox

$ TASKDATA=/tmp/task task rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76 add test2 depends:1
TASKDATA override: /tmp/task
Created task 2.
Configuration override rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76
Tagged test2 as inbox

$ TASKDATA=/tmp/task task rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76 sync init
Please confirm that you wish to upload all your tasks to the Taskserver (yes/no) y
TASKDATA override: /tmp/task
Syncing with host:port

Configuration override rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76
Sync successful.  2 changes uploaded.

<Clear all data from the Foreground app, set it up to sync to the new test user, complete the "test2" task, sync again>

$ TASKDATA=/tmp/task task rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76 sync
TASKDATA override: /tmp/task
Configuration override rc.taskd.credentials:adam/test/e65cfbf7-9183-424b-8d54-46798c3afe76
Unrecognized Taskwarrior file format or blank line in data.

This seems similar to #110 to me, but that issue has been fixed.

I'm running a self-hosted taskd 1.2.0 instance, compiled from source, on a Raspberry Pi running Debian Bookworm. The task client is the Debian packaged version 2.6.2+dfsg-1, on the same machine. The Foreground client is version 1.5.5 from the Google Play Store on a Fairphone 4 running stock Android 12.

@Sudneo
Copy link

Sudneo commented Sep 23, 2023

I am experiencing the same exact error with version 1.6.1 of foreground as well.

Marking a task with a dependency causes the tx.data to have the depends key such as:

"depends":"[\"30800057-5230-4d8f-8baf-95f0e13d2f2b\"]"

Manually changing to

"depends":["30800057-5230-4d8f-8baf-95f0e13d2f2b"]

Fixes the issue.

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

No branches or pull requests

2 participants