CCExtractor / taskwarrior-flutter

This is the repo of mobile app of taskwarrior
https://play.google.com/store/apps/details?id=com.ccextractor.taskwarriorflutter
GNU General Public License v3.0
120 stars 88 forks source link

Json Sync #328

Open shfattig opened 7 months ago

shfattig commented 7 months ago

Describe your improvement idea or feature request

Hey guys! This is awesome! Good to see a nice mobile app under development for TW.

I like to rely on SyncThing for a lot of my file syncing, which works great for text files. The task server works well but it's a dependency I shouldn't need with TW's json export (which is apparently the recommended 3rd party integration mechanism). What would it take to support json as a sync option?

How would you like to see it implemented?

  1. Select sync option "json file"
  2. Select file/dir

Put here any screenshots or videos (optional)

No response

How can we contact you (optional)

No response

Would you like to work on this issue?

None

By submitting this issue, I have confirmed that:

Pavel401 commented 7 months ago

@shfattig Do you mean we should have an option to sync tasks using Syncthing?

shfattig commented 7 months ago

I don't think you need to care about how the syncing is done, as long as you can read and write json to an arbitrary directory selected by the user

shfattig commented 7 months ago

SyncThing is peer to peer so it works across the internet. I think the initial connection is made on LAN for ease/security

shfattig commented 7 months ago

Question - have you embedded the taskwarrior binary in your Android app? Or how do you accomplish the TW functionality? I'm impressed that you handle so many features in the app

shfattig commented 7 months ago

It looks like you already have the json export! Just need to read it as well

Pavel401 commented 6 months ago

Question - have you embedded the taskwarrior binary in your Android app? Or how do you accomplish the TW functionality? I'm impressed that you handle so many features in the app

The app uses the same data models and merging algorithms as the original TaskWarrior, it even uses the same protocol to sync with taskserver.

Pavel401 commented 6 months ago

It looks like you already have the json export! Just need to read it as well

Are you suggesting an option to import tasks from a JSON file? Is that correct?

shfattig commented 6 months ago

Question - have you embedded the taskwarrior binary in your Android app? Or how do you accomplish the TW functionality? I'm impressed that you handle so many features in the app

The app uses the same data models and merging algorithms as the original TaskWarrior, it even uses the same protocol to sync with taskserver.

Oh wow! So you've basically reimplemented TW on mobile?

shfattig commented 6 months ago

It looks like you already have the json export! Just need to read it as well

Are you suggesting an option to import tasks from a JSON file? Is that correct?

Correct! But not merely an instantaneous import. I'd like to export to a json on every write, and import from the same json every update (whether that's some interval, every time the app is opened, etc - I'm sure you have that defined now for the task server).

Pavel401 commented 6 months ago

It looks like you already have the json export! Just need to read it as well

Are you suggesting an option to import tasks from a JSON file? Is that correct?

Correct! But not merely an instantaneous import. I'd like to export to a json on every write, and import from the same json every update (whether that's some interval, every time the app is opened, etc - I'm sure you have that defined now for the task server).

We can include a feature that allows you to import tasks as a JSON file. If you have set up a task server, you can enable the "Sync on Start" and "Sync on Task Create" options. This will ensure that all your tasks are automatically synced with the task server.

At the moment, instantaneous bidirectional task synchronization is not supported due to restrictions with TaskServer. The original protocol uses TCP, which makes it very difficult to work with. However, we are currently planning to build our own TaskServer. Once this is done, we will be able to achieve bidirectional task synchronization as well as notifications.

shfattig commented 6 months ago

Sorry, I may not understand your comment.

The goal here is to accomplish task syncing without a task server. Many privacy/security-conscious techies like myself rely on services like SyncThing to provide encrypted, p2p sync connections directly between their devices, thereby removing (mostly) any dependency on cloud services.

Because Taskwarrior provides a beautiful, robust json interface, which is plain text, SyncThing can handle syncing very nicely if the apps used to interact with the task list consistently use the json file as a sort of "backend". Any changes made remotely would be synced to the json file, so that opening the mobile app reads the file and receives the update. Any changes made in the mobile app are also written to the json file so that remote devices can receive updates.

Are you saying that handling json would still require interacting through a task server?

cfsmp3 commented 5 months ago

I think I understand what @shfattig wants. I does makes sense I guess...

You want a JSON file stored on the device to be written to (overwrite whatever it contains) when a change is made on the app and trust that SyncThing will copy it to whatever other devices it needs to be written to, and read if there's an external change to it (possibly because the task list was modified in a different device and then SyncThing copied the modified JSON to our device), correct?

shfattig commented 5 months ago

That is exactly correct! You rock. I'm sorry if that was unclear