gtg icon indicating copy to clipboard operation
gtg copied to clipboard

index backends by id, not by name

Open cpitclaudel opened this issue 2 years ago • 7 comments

This allows GTG to have multiple backends of one kind at the same time.

  • GTG/backends/init.py (BackendFactory.get_saved_backends_list): Rename backend to backend_id for clarity. Call config.rename_backend_section on each backend for compatibility with previous versions of GTG.
  • GTG/core/config.py (CoreConfig_.rename_backend_section): New function to rename a config section (from backend name to backend ID). (CoreConfig_.get_all_backends): Rename backend to backend_id for clarity.
  • GTG/core/datastore.py (DataStore.save): Retrieve config section by backend id, not by backend name.

Fixes #930.

cpitclaudel avatar Sep 19 '22 07:09 cpitclaudel

@cpitclaudel hey, thanks! We're in the middle of a big port ATM and I'm focusing all the time I can find in that. Once #894 is ready to land, I'll review this and merge. Luckly it looks like this branch won't generate any conflicts, though we'll have to port the change in datastore over to the new datastore.

diegogangl avatar Oct 08 '22 22:10 diegogangl

Looking forward to that :) Good luck with the port!

cpitclaudel avatar Oct 09 '22 16:10 cpitclaudel

It is time now! Monsieur @cpitclaudel, rebasez donc cette branche, et lâchez les chiens!

See also the updated general status and convenient links in #737.

nekohayo avatar Feb 26 '24 18:02 nekohayo

This will also be relevant to @jaesivsm's interests.

nekohayo avatar Feb 26 '24 18:02 nekohayo

Congrats on the big merge! :)

I rebased this, but I'll need help to test:

  • I haven't used GTG since I opened this PR
  • I'm not familiar with the code base anymore
  • At first glance, I'm not 100% sure how the new datastore should be updated

After a quick glance through the code, I'm also not entirely certain of what a backend module refers to, so the change may not be right in the new architecture?

cpitclaudel avatar Mar 02 '24 21:03 cpitclaudel

Hi @cpitclaudel, sorry for the delay. At first glance, this sounds like a good idea. The problem is that the only backend module we have now is caldav, since the "local" backend is now integrated into the datastore. And the Caldav backend has a fair share of bugs too from the refactor. On top of that, there are some potential problems with having more than caldav backend like race conditions when synchronizing that need careful work and testing.

Since we are trying to finish 0.7 at this moment, I'll remove the milestone for this and leave it open for later

diegogangl avatar Jun 03 '24 18:06 diegogangl

Sure thing, good luck with the 0.7 release! I look forward to using GTG when CalDAV is back :)

cpitclaudel avatar Jun 03 '24 20:06 cpitclaudel