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

Initial properties are not properly handled, resulting in local duplicate events #25

Closed
barryridge opened this issue Dec 5, 2018 · 4 comments

Comments

@barryridge
Copy link

barryridge commented Dec 5, 2018

If I add an event such as this one:

* Test Event 1
  :PROPERTIES:
  :LOCATION: Location 1
  :END:
  <2018-12-06 Thu>

after using either org-gcal-post-at-point or org-gcal-sync, the result is as follows:

* Test Event 1
  :PROPERTIES:
  :LOCATION: Location 1
  :LINK: [[https://www.google.com/calendar/event?eid=xxx][Go to gcal web page]]
  :ID: xxx
  :END:

  <2018-12-06 Thu>

  :PROPERTIES:
  :LOCATION: Location 1
  :END:
  <2018-12-06 Thu>

If, on the other hand, I drop the properties altogether from the entry as follows:

* Test Event 2
  <2018-12-06 Thu>

and then run org-gcal-sync, I get the following:

* Test Event 2
  :PROPERTIES:
  :LINK: [[https://www.google.com/calendar/event?eid=xxx][Go to gcal web page]]
  :ID: xxx
  :END:

  <2018-12-06 Thu>

The Test Event 1 case leaves duplicate events in the local org file (as you can see from the above) but not in the Google calendar. Nevertheless, it is still quite a nuisance. One workaround, that works in the case of Test Event 1, is to just delete the trailing properties and timestamp and re-sync. Another workaround, that works in the case of Test Event 2 is to just add the :LOCATION: property to the updated event after the sync, once the :ID: and :LINK: properties have been added, then re-sync.

Note that I am using the google-calendar-layer (or at least my own working fork of it), as well as multiple calendars. I would gladly dig into this a bit further myself, but I'm afraid my E-Lisp skills are not quite up to the challenge, currently.

@phrxmd
Copy link

phrxmd commented Dec 8, 2018

I fixed that for myself in myuhe#122. It's a simple change to the regexp that recognizes the property block. Check if it fixes it for you.

@phrxmd
Copy link

phrxmd commented Dec 8, 2018

Ported the change to this branch, see #27.

@barryridge
Copy link
Author

Just confirmed that your merged PR is working for me now that it has been updated on melpa. Thank you very much @phrxmd

@yangsheng6810
Copy link

I am having this issue with org-capture. I typed the following in org-capture and finish.

* Yet another org-gcal event
  :PROPERTIES:
  :LOCATION: 1110 Kim Engineering Building
  :END:

  <2019-04-23 二 16:35>

What I get after it automatically post the item:

* Yet another org-gcal event
  :PROPERTIES:
  :LOCATION: 1110 Kim Engineering Building
  :END:

  <2019-04-23 二 16:35>

  <2019-04-23 二 16:35>

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

3 participants