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

CalDav: VTODO without CREATED field corrupts the xml store #1033

Open
picsel2 opened this issue Feb 29, 2024 · 0 comments
Open

CalDav: VTODO without CREATED field corrupts the xml store #1033

picsel2 opened this issue Feb 29, 2024 · 0 comments
Labels
bug plugins Plugins and extra backends priority:critical regression Essential features that recently broke reproducible-in-git Issues that affect the current dev version

Comments

@picsel2
Copy link
Member

picsel2 commented Feb 29, 2024

Failure description

GTG (master) crashes at startup.

Context: Startup

Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/GTG/gtk/application.py", line 115, in do_startup
    self.ds.find_and_load_file(data_file)
  File "/app/lib/python3.11/site-packages/GTG/core/datastore.py", line 407, in find_and_load_file
    self.load_file(filepath)
  File "/app/lib/python3.11/site-packages/GTG/core/datastore.py", line 109, in load_file
    self.load_data(self.xml_tree)
  File "/app/lib/python3.11/site-packages/GTG/core/datastore.py", line 92, in load_data
    self.tasks.from_xml(data.find('tasklist'), self.tags)
  File "/app/lib/python3.11/site-packages/GTG/core/tasks.py", line 780, in from_xml
    added = dates.find('added').text
            ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'text'

Software versions:

  • Getting Things GNOME! 0.6.0
  • CPython 3.11.7 (main, Nov 10 2011, 15:00:00) [GCC 13.2.0]
  • GTK 4.12.5, GLib 2.78.4
  • PyGLib 3.46.0, PyGObject 3.46.0
  • Linux-6.7.5-200.fc39.x86_64-x86_64-with-glibc2.38
  • Flatpak 1.15.6
  • Flatpak runtime: runtime/org.gnome.Platform/x86_64/45 (57d12cbe72e28d786a210eced336f3ebcd99a229dd6dc1d55917cb9efb1ffa7d)
  • Flatpak app: org.gnome.GTGDevel (e327307520d14e896a85005d21d346e3c7317fa94a671e1a7c93ab57f923ffe9)

Source of failure

Syncing a task that has no CREATED field leads to a state where the task's 'date_added' attribute is not set.
The xml task element that is subsequently written to disk has then no added tag, although the schema requires it to be always present.

Examples

Content of an ical file without CREATED field (this VTODO was created by Nextcloud Deck):

BEGIN:VCALENDAR
PRODID:-//Ximian//NONSGML Evolution Calendar//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTODO
DTSTAMP:20231121T193352Z
UID:deck-card-986
RELATED-TO:deck-stack-83
STATUS:NEEDS-ACTION
SUMMARY:Sturm des Wissens – Rostocks Netzwerk für Wissenschaft\, 
 Wirtschaft\, Politik und Bildung
DESCRIPTION:https://rostock365.de/sturm-des-wissens/
X-EVOLUTION-CALDAV-ETAG:b00f4accffd2039b526643f421925b48
END:VTODO
END:VCALENDAR

Resulting xml element where the added tag is missing:

<task id="deck-card-986" status="Active" uuid="deck-card-986" recurring="False">
      <tags>
        <tag>3f3ab74c-5f52-4566-b62c-cc76bcc7d06a</tag>
      </tags>
      <title>Sturm des Wissens – Rostocks Netzwerk für Wissenschaft, Wirtschaft, Politik und Bildung</title>
      <dates>
        <modified>2023-11-08 14:14:27.529767</modified>
      </dates>
      <recurring enabled="false">
        <term>None</term>
        <updated_date>9999-12-30</updated_date>
      </recurring>
      <subtasks/>
      <content><![CDATA[@Deck:_GTD

https://rostock365.de/sturm-des-wissens/]]></content>
    </task>
@nekohayo nekohayo added bug priority:critical reproducible-in-git Issues that affect the current dev version plugins Plugins and extra backends labels Mar 1, 2024
@nekohayo nekohayo added the regression Essential features that recently broke label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugins Plugins and extra backends priority:critical regression Essential features that recently broke reproducible-in-git Issues that affect the current dev version
Projects
None yet
Development

No branches or pull requests

2 participants