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

bug when updating required_attendees in the event #1355

Open
ChmilDmitrii opened this issue Feb 6, 2025 · 2 comments
Open

bug when updating required_attendees in the event #1355

ChmilDmitrii opened this issue Feb 6, 2025 · 2 comments

Comments

@ChmilDmitrii
Copy link

Hello,

Case:

  1. Add a list of participants to the event via the owa client
  2. Get the event via exchangelib, in the required_attendees attribute the list of participants will be like Mailbox with mailbox_type = "PrivateDL" and the object will have an item_id
  3. Add a new participant to the event and save it

Result: the contact list will be removed from the event

Probable causes: in Mailbox in item_id is_read_only=True is specified, because of which the item_id is not sent to the calendar server

Please tell me, is this the expected behavior and there is no support for the list of participants in exchangelib? or is this a bug?

Python 3.11, exchangelib 5.2.0

@ecederstrand
Copy link
Owner

The required_attendees is supposed to work. Can you post some example code showing the problem? Is it only an issue for items created via OWA, or also for items created via exchangelib?

@ChmilDmitrii
Copy link
Author

for example
(some elements removed for readability)

i get an event with some required_attendees

item = account.calendar.get(id="some_item_id")

calendar server response

<t:RequiredAttendees>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>user 01</t:Name>
            <t:EmailAddress>[email protected]</t:EmailAddress>
            <t:RoutingType>SMTP</t:RoutingType>
            <t:MailboxType>Mailbox</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>all test users</t:Name>
            <t:RoutingType>MAPIPDL</t:RoutingType>
            <t:MailboxType>PrivateDL</t:MailboxType>
            <t:ItemId Id="some_id" ChangeKey="some_changekey"/>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
</t:RequiredAttendees>

then I add to required_attendees

item.required_attendees.append(Attendee(mailbox=Mailbox(email_address="[email protected]")))

request for updates to the calendar server

<t:RequiredAttendees>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>user 01</t:Name>
            <t:EmailAddress>[email protected]</t:EmailAddress>
            <t:RoutingType>SMTP</t:RoutingType>
            <t:MailboxType>Mailbox</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>all test users</t:Name>
            <t:RoutingType>MAPIPDL</t:RoutingType>
            <t:MailboxType>PrivateDL</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>user 02</t:Name>
            <t:EmailAddress>[email protected]</t:EmailAddress>
            <t:RoutingType>SMTP</t:RoutingType>
            <t:MailboxType>Mailbox</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
</t:RequiredAttendees>

after updating all_test_users in owa disappears, while there are no errors in the response to the event update from the calendar server

if I change item_id in the Mailbox class

class Mailbox(EWSElement):

    item_id = EWSElementField(value_cls=ItemId)

the request for updates to the calendar server takes this form

<t:RequiredAttendees>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>user 01</t:Name>
            <t:EmailAddress>[email protected]</t:EmailAddress>
            <t:RoutingType>SMTP</t:RoutingType>
            <t:MailboxType>Mailbox</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>all test users</t:Name>
            <t:RoutingType>MAPIPDL</t:RoutingType>
            <t:MailboxType>PrivateDL</t:MailboxType>
            <t:ItemId Id="some_id"/>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
    <t:Attendee>
        <t:Mailbox>
            <t:Name>user 02</t:Name>
            <t:EmailAddress>[email protected]</t:EmailAddress>
            <t:RoutingType>SMTP</t:RoutingType>
            <t:MailboxType>Mailbox</t:MailboxType>
        </t:Mailbox>
        <t:ResponseType>Unknown</t:ResponseType>
    </t:Attendee>
</t:RequiredAttendees>

after the update all_test_users in owa does not disappear

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

2 participants