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

Copied events add self as attendee #516

Open
adrougk opened this issue Oct 21, 2022 · 9 comments
Open

Copied events add self as attendee #516

adrougk opened this issue Oct 21, 2022 · 9 comments
Labels
defect This is a bug

Comments

@adrougk
Copy link

adrougk commented Oct 21, 2022

Describe the problem and steps to reproduce it:

Copying events without attendees with option "Synchronize events attendees" activated adds self as attendee to copies.

What happened?

I copied an event with zero attendees and the copy was turned into an event with self as attendee. Disactivating the "Synchronize events attendees" option eliminates this behaviour.

What did you expect to happen?

I would expect that the copies of events without attendees would not add self as an attendee.

Anything else we should know?

No error message is produced.

@kewisch
Copy link
Owner

kewisch commented Nov 30, 2022

Confirming this based on code inspection. We do add the organizer as an attendee by default. I'm not sure if this is required in some way, either due to how Thunderbird works or the gdata API. Do you have the ICS of the event you are copying? Does it have an ORGANIZER property?

@kewisch kewisch added needinfo Need more information defect This is a bug labels Nov 30, 2022
@adrougk
Copy link
Author

adrougk commented Nov 30, 2022

I create an event in TB and by default I am added as Organizer. The list of attendees is blank.

The copied event has the same Organizer property but with the Organizer added as an attendee.

@github-actions github-actions bot removed the needinfo Need more information label Nov 30, 2022
@unode
Copy link

unode commented Aug 14, 2023

This now seems to apply to any event created via Thunderbird. The organizer is always added as a guest.

If I remove myself from the list of attendees, everything works normally.
It's not clear to me why the organizer needs to be added as a guest.

Creating an event through Google Calendar doesn't add oneself as attendee either.

@kewisch
Copy link
Owner

kewisch commented Oct 15, 2023

I'm going to need the ICS of the event so I can reproduce this easier, @adrougk is this something you can provide?

@unode I'm not sure I understand the distinction you are making. If I create an event in Google Calendar and invite someone else, it shows two people for the event, the organizer (myself) and the person I invited. If I create an event in Thunderbird with no further attendees, I don't see attendees nor organizer in both places. It seems consistent?

@kewisch
Copy link
Owner

kewisch commented Oct 15, 2023

If you are proficient with javascript, maybe you can edit the add-on's sources with this patch to see if it works better:

diff --git a/src/legacy/modules/gdataUtils.jsm b/src/legacy/modules/gdataUtils.jsm
index cd4b0e7..21a31e3 100644
--- a/src/legacy/modules/gdataUtils.jsm
+++ b/src/legacy/modules/gdataUtils.jsm
@@ -412,20 +412,13 @@ function EventToJSON(aItem, aOfflineStorage, aIsImport) {
       return attendeeData;
     };

-    let needsOrganizer = true;
     let attendeeData = [];
     for (let attendee of aItem.getAttendees()) {
       attendeeData.push(createAttendee(attendee));
-      if (aItem.organizer && aItem.organizer.id == attendee.id) {
-        needsOrganizer = false;
-      }
     }

     if (aItem.organizer) {
       itemData.organizer = createAttendee(aItem.organizer);
-      if (needsOrganizer) {
-        attendeeData.push(itemData.organizer);
-      }
     }

     if (attendeeData.length) {

@kewisch kewisch added the needinfo Need more information label Oct 15, 2023
@adrougk
Copy link
Author

adrougk commented Oct 15, 2023

I'm going to need the ICS of the event so I can reproduce this easier, @adrougk is this something you can provide?

@unode I'm not sure I understand the distinction you are making. If I create an event in Google Calendar and invite someone else, it shows two people for the event, the organizer (myself) and the person I invited. If I create an event in Thunderbird with no further attendees, I don't see attendees nor organizer in both places. It seems consistent?

Sorry, I no longer use this addon and cannot right now reproduce the error nor provide an ICS created by it.

@github-actions github-actions bot removed the needinfo Need more information label Oct 15, 2023
@kewisch
Copy link
Owner

kewisch commented Oct 15, 2023

No problem, thanks for getting back though! @unode could you try the patch?

@kewisch kewisch added the needinfo Need more information label Oct 15, 2023
@unode
Copy link

unode commented Oct 16, 2023

Does Thunderbird or the XPI signing system restrict editing the contents of the XPI file?

I tried the changes above but then the Calendar interface reports that the add-on is no longer available and doesn't allow using the configured accounts.

I was trying to modify the XPI in-place. Re-installing locally worked around that part.

Regarding the patch, I think it goes in the right direction but is incomplete.

With the current XPI release the following happens:

  1. Creating an event adds no one to attendee list
  2. Editing the event adds me as attendee, even if I don't add anyone else to the invitees list
  3. Trying to add someone to the invitees list pre-populates it with my own address (making me be both organizer and attendee - this distinction isn't shown in Google's interface)

With the above patch:

  1. No change here
  2. Now no longer adds my email to attendee list
  3. Still populates the invitees list with my email

In point 3 having my name in the invitees list doesn't seem to be required. I can remove myself or replace my email with a different address and everything still works normally.
Could we also make it such that the organizer's email isn't added to the invitees list? If we do this I think that's everything needed to close this issue.

@github-actions github-actions bot removed the needinfo Need more information label Oct 16, 2023
@unode
Copy link

unode commented Oct 19, 2023

An update on the above, I have been using the proposed changes for some time and they seem to have some unwanted consequences.
With the patch, when updating the list of invitees no availability is shown. A gray bar is displayed instead.
I also noticed that before the patch, pasting a list of emails separated by commas in the invitee edit window automatically split one email per line. However with the patch this stopped working.
My guess is that what causes the gray bar also interrupts the splitting of email addresses per-line.

Turns out this is unrelated and seems to be caused by reinstalling any version of the plugin without restarting Thunderbird.
After a restart the "gray bar" symptom is gone.

More testing needed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants