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

make it so that imported events retain UID and duplicate IDs will fail gracefully #584

Closed
wants to merge 1 commit into from

Conversation

tsheinen
Copy link

@tsheinen tsheinen commented Feb 2, 2021

see #583 and #492

I modified this for my own purposes and I stopped at "it works for my use case and doesn't make any tests fail". I don't think I missed anything important but I don't mind spending some more time on it if needed. I think not importing defaults is pretty reasonable default behavior -- I personally would not expect an import to create duplicate events if the event IDs are the same. Thoughts?

@michaelmhoffman
Copy link
Collaborator

I don't have time to get familiar with that part of the codebase and review but I agree with your description of the desired behavior. Basically I think this should try to reproduce what the Google Calendar web interface does when given repeated imports of the same thing, which to my knowledge is as you describe.

@pschmitt
Copy link

pschmitt commented Mar 1, 2021

I have tested this PR and can confirm it works as expected, thanks!

@pschmitt
Copy link

pschmitt commented Mar 3, 2021

Here's more feedback:

In its current state this PR does not allow importing updated events (ie. SEQUENCE got incremented).

Ideally gcalcli would fetch the existing event (same UID) and update it if SEQUENCE has been incremented and ignore events who have not changed (same UID and same SEQUENCE)

@cryhot
Copy link

cryhot commented May 12, 2021

Updating events would be a much welcome behavior! It would be even better than a graceful fail.

May I suggest using service.events().import(**kwargs) instead of service.events().insert(**kwargs), when 'iCalUID' in event is True?

I did some tests from the google developers API page, the behavior of import seems correct.

I can create an other pull request but I wanted to have your thoughts first!

@cryhot cryhot mentioned this pull request May 23, 2021
@dbarnett dbarnett assigned dbarnett and unassigned dbarnett Aug 25, 2024
@dbarnett dbarnett self-requested a review August 25, 2024 06:42
@dbarnett
Copy link
Collaborator

Hello from 2024! This change no longer merges cleanly, but I put together an updated PR #712 based on cryhot's change that should fix these issues. Would anyone be able to give that version a try and make sure it's not horribly broken so I can finally merge a fix for this? =)

@dbarnett dbarnett closed this Aug 25, 2024
@dbarnett dbarnett removed their request for review August 25, 2024 23:34
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

Successfully merging this pull request may close these issues.

5 participants