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

Json Sync #328

Open
1 task done
shfattig opened this issue Mar 4, 2024 · 13 comments
Open
1 task done

Json Sync #328

shfattig opened this issue Mar 4, 2024 · 13 comments
Labels
enhancement New feature or request

Comments

@shfattig
Copy link

shfattig commented Mar 4, 2024

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:

  • I have starred the repo ⭐ and watched 👀 it on GitHub and followed the contribution guidelines.
@shfattig shfattig added the enhancement New feature or request label Mar 4, 2024
@Pavel401
Copy link
Member

Pavel401 commented Mar 5, 2024

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

@shfattig
Copy link
Author

shfattig commented Mar 5, 2024

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
Copy link
Author

shfattig commented Mar 5, 2024

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

@shfattig
Copy link
Author

shfattig commented Mar 5, 2024

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
Copy link
Author

shfattig commented Mar 7, 2024

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

@Pavel401
Copy link
Member

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
Copy link
Member

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
Copy link
Author

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
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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
Copy link
Collaborator

cfsmp3 commented May 5, 2024

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
Copy link
Author

shfattig commented May 6, 2024

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

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

No branches or pull requests

3 participants