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

Issue updating online meeting after upgrade to 6.6.0 #1937

Open
ccea-dev-team opened this issue Apr 17, 2024 · 2 comments
Open

Issue updating online meeting after upgrade to 6.6.0 #1937

ccea-dev-team opened this issue Apr 17, 2024 · 2 comments
Labels
type:bug A broken experience type:regression A bug from previous release

Comments

@ccea-dev-team
Copy link

ccea-dev-team commented Apr 17, 2024

I create an event with the online meeting flag set to true. Then I use the join url from this event to update it's backing online meeting to set a meeting co-organizer (this 2 step process seems to be the only way to set a co-organizer for an online meeting created from an event). This process worked fine in version 6.4.0 but after upgrading to 6.6.0 I get the following error when calling patch on the online meeting -

com.microsoft.graph.models.odataerrors.ODataError: Updating meeting type is not supported.
at com.microsoft.graph.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36) ~[microsoft-graph-6.6.0.jar:na]
at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:212) ~[microsoft-kiota-serialization-json-1.1.4.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:678) ~[microsoft-kiota-http-okHttp-1.1.4.jar:na]
at com.microsoft.kiota.ApiExceptionBuilder.(ApiExceptionBuilder.java:26) ~[microsoft-kiota-abstractions-1.1.2.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:677) ~[microsoft-kiota-http-okHttp-1.1.4.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:285) ~[microsoft-kiota-http-okHttp-1.1.4.jar:na]

Code that worked in version 6.4.0 below. Error happening in 6.6.0 when the patch is called on online meeting at the end-

public static Event createOnlineMeeting(String meetingOwnerEmail, String meetingName, Calendar meetingStartTime, Calendar     meetingEndTime, String meetingInviteBody, List<OnlineMeetingAttendee> attendees) throws Exception
{
	Event event = new Event();
	
	event.setSubject(meetingName);
	
	event.setBody(new ItemBody());
	
	event.getBody().setContentType(BodyType.Html);
	
	event.getBody().setContent(meetingInviteBody);
	
	event.setStart(new DateTimeTimeZone());
	
	event.getStart().setTimeZone(TIMEZONE);
	
	event.getStart().setDateTime(TIME_FORMAT.format(meetingStartTime.getTime()));
	
	event.setEnd(new DateTimeTimeZone());	
	
	event.getEnd().setTimeZone(TIMEZONE);
	
	event.getEnd().setDateTime(TIME_FORMAT.format(meetingEndTime.getTime()));
	
	event.setLocation(new Location());
	
	event.getLocation().setDisplayName("Online");
	
	event.setAllowNewTimeProposals(false);
	
	event.setIsOnlineMeeting(true);
	
	event.setOnlineMeetingProvider(OnlineMeetingProviderType.TeamsForBusiness);
	
	if(attendees == null || attendees.isEmpty())
	{
		checkAccessToken();
	
		return graphClient.users().byUserId(meetingOwnerEmail).events().post(event, requestConfiguration -> {
            requestConfiguration.headers.add("Prefer", OUTLOOK_TIMEZONE);
            });
	}
	
	List<Attendee> attendeeList = new ArrayList<>();
	
	for(OnlineMeetingAttendee attendee : attendees)
	{
		Attendee att = new Attendee();
		
		EmailAddress attEmail = new EmailAddress();
		
		attEmail.setAddress(attendee.getEmail());
		
		att.setEmailAddress(attEmail);
		
		attendeeList.add(att);
	}
	
	event.setAttendees(attendeeList);
	
	checkAccessToken();

	Event newEvent = graphClient.users().byUserId(meetingOwnerEmail).events().post(event, requestConfiguration -> {
        requestConfiguration.headers.add("Prefer", OUTLOOK_TIMEZONE);
        });
	
	User user = graphClient.users().byUserId(meetingOwnerEmail).get();

	OnlineMeetingCollectionResponse response = graphClient.users().byUserId(user.getId()).onlineMeetings().get(requestConfiguration -> {
		requestConfiguration.headers.add("Prefer", "include-unknown-enum-members");
		requestConfiguration.queryParameters.filter = "JoinWebUrl eq '" + newEvent.getOnlineMeeting().getJoinUrl() + "'";
		});
	
	OnlineMeeting meeting = response.getValue().get(0);
	
	List<MeetingParticipantInfo> parList = new ArrayList<>();
	
	MeetingParticipants par = new MeetingParticipants();
		
	for(OnlineMeetingAttendee attendee : attendees)
	{
		MeetingParticipantInfo parInfo = new MeetingParticipantInfo();
		
		parInfo.setUpn(attendee.getEmail());
		
		parInfo.setRole(OnlineMeetingRole.valueOf(attendee.getRole().toString()));
		
		parList.add(parInfo);
	}
		
	par.setAttendees(parList);
	
	meeting.setParticipants(par);
	
	LobbyBypassSettings lobbySettings = new LobbyBypassSettings();
		
	lobbySettings.setScope(LobbyBypassScope.Invited);
	
	meeting.setLobbyBypassSettings(lobbySettings);
	
	checkAccessToken();
	
       //ODataError: Updating meeting type is not supported error happening here in 6.6.0 but not 6.4.0
	graphClient.users().byUserId(user.getId()).onlineMeetings().byOnlineMeetingId(meeting.getId()).patch(meeting, requestConfiguration -> {
		requestConfiguration.headers.add("Prefer", "include-unknown-enum-members");
		});
	
	return newEvent;	
}
@ccea-dev-team
Copy link
Author

ccea-dev-team commented Apr 17, 2024

Some background to setting a meeting co-organizer for an online meeting created from an Event -

#1834

The way that was suggested there by @Ndiritu was to create the online meeting first, set the co-organizer, then use the join url when creating the Event. This didn't work as when the event is saved it overwrites the join url from the online meeting with its own join url. So I had to create the Event first then get the backing online meeting from that event and update the co-organizer on that. This worked fine on version 6.4.0 but now does not work on 6.6.0 with the error -

com.microsoft.graph.models.odataerrors.ODataError: Updating meeting type is not supported.

@Ndiritu Ndiritu added type:bug A broken experience type:regression A bug from previous release labels Apr 22, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Apr 22, 2024

Thanks for the detailed issue and additional context @ccea-dev-team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience type:regression A bug from previous release
Projects
None yet
Development

No branches or pull requests

2 participants