Microsoft Calendar Graph API : Id of event not shared between users - web-services

I'm currently working on the Microsoft Calendar Graph API and I ran into some problems when trying to synchronize events.
Basically what I have is 2 users on my web service : they both have an Outlook adress. User A create an event on my web service, and add User B as an attendee. The event is then send to Outlook using the REST API. It's created on User A Outlook calendar, and User B receive an invitation on Outlook and the event is created as well in his Outlook calendar.
Now, on my web service, when the event is created, I retrieve the Microsoft ID of the event and store it in my database. This way, when I want to synchronize events between Outlook calendar and my calendar, all I do is retrieve all Outlook events, check their ID and see if they are stored in my database : if they are, then the event already exists on my web service, if they are not then I create the event in my web service.
The problem I have is that when I try to get the Outlook events from User B, the ID of the event is different than the one I stored earlier, and therefore it creates a duplicate that I don't need.
Basically, the event on User A outlook calendar and User B outlook calendar have different ID. I don't understand what's the point of this, because they are the same, the one on User B outlook calendar is just an invitation to the one from User A outlook calendar.
My question is : is there any way I can get around that ? Is there any kind of ID that is shared through users in Outlook/Office365 ? Thanks a lot !

This is precisely what the iCalUId property is for. The id is by design different, as it's a sort of "primary key" for the user's mailbox database. The iCalUId is supposed to be the same across calendars.
From https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/event:
iCalUId - String - A unique identifier that is shared by all instances of an event across different calendars.

There is AFAIK no property that is unique and also constant across different mailboxes. You can add custom properties to events, and make sure that the property value is unique and constant. That would require you to be able to write to User A's events.

Related

Retrieve data (iCalUId) from newly created event

I'm trying to synchronize a sharepoint list and an outlook calendar through power automate flows.
Following several posts here and there, I managed to successfully create 2 flows:
When an event is created or modified in outlook an item is created or updated in the sharepoint list. To link the two I'm storing iCalUId from the outlook event into an eventID column in the sharepoint list.
When an item is modified in the sharepoint lost, the event is updated in the outllok calendar, again, using eventID <-> iCalUId as a link/key
What I need now is to create an outlook event when a new SP item is created. I am stuck at the point where after creating the outlook event, I would need to retrieve back the iCalUId from the newly created event, and store that back in the item in the list.
Any idea or hint on how to do that would be great ;-)
Thanks !
It is recommended that you directly use the calendar app in the classic mode in SharePoint, and then select Connect to Outlook to synchronize the two calendars.
For more information, please refer to:
https://www.rrc.ca/its/help-resources/sharepoint/connect-sharepoint-calendar-to-outlook-calendar/
https://agsci.psu.edu/it/how-to/connect-sharepoint-2013-calendar-to-your-outlook-calendar

What's the best practice to implement "read receipts" on group chats in AWS AppSync and Amplify?

I'm building an Angular 11 web app using AppSync for the backend.
I've mentioned group chat, but basically I have a feature in my app where I have an announcement feature where there's a person creating announcements to a specific audience (can be individual members or groups of members) and whenever the receiving user opens the announcement, it has to mark that announcement as read for that user in their UI and also let the sender know that it has been opened by that particular member.
I have an idea for implementing this:-
Each announcement needs to have a "seenBy" which aggregates the user Ids of the ones who open it.
Each member also has an attribute in their user object named "announcementsRead" which is an array of Ids of the announcements that they have opened.
In the UI when I'm gathering the list of announcements for the user, the ones whose ID don't belong in the member's own announcementsRead array, will be marked as unread.
When they click on it and it is opened, I make 2 updates - a) To the announcement object I simply push the member's user ID to the "seenBy" attribute and push to db. b) to the member's user object, I add the announcement's id to the "announcementRead" attribute and push it to the DB.
This is just something that I came up with.
Please let me know if there are any pitfalls to this approach. Or if there are simpler ways to achieve this functionality.
I have a few concerns as well:-
Let's say that two users are opening an announcement at the same time, and the clients try to update the announcement with the updated seenBy containing the user's ID, what happens when the two requests from two different clients are happening concurrently? It's possible that the first user fetches the object and then the second user fetches it immediately, and by the time the second user has updated the attribute and sent it back to the DB, the first user has already written their updated data. In such a case the second user's write to the DB will overwrite the first user's change. I am not sure of the internal mechanisms of the amplify data store, but I can imagine this happening. Is this possible? If so, how do we ensure that it is prevented?
Is it really necessary for me to maintain the "announcementsRead" attribute in the user? I mean I can imagine generating that list in the UI every time I get the list of announcements by checking if the current user's ID exists in the announcement's "seenBy" and maintaining that list in the UI, that way we can eliminate redundancy of info in the DB and also it would make sense to not accumulate extremely old announcement IDs that may have been deleted. But I'm wondering if having this on the member actually helps in an indispensable way.
Hope my questions are clear.

Microsoft Dynamics 365 - workflow process to generate a calendar entry that synchronises with Exchange/Outlook calendar

I'm building a workflow process in Dynamics 365 triggered by changes to a date/time field in the Opportunity entity - this should create (or update) a [Dynamics] Calendar entry for the user to whom this Opportunity is assigned on the date/time in question, which should then automatically synchronise with the user's Exchange calendar because server side Exchange synchronisation is enabled.
I've hit a brick wall with this having tried every option I can think of - the following aspects work but not the end to end solution:
1) The workflow is triggered as expected, and correctly creates the calendar entry in the Dynamics Calendar;
2) If I manually create an entry in the Dynamics Calendar it appears in the user's Exchange calendar, so I know the server side synchronisation is working correctly.
However ... calendar entries created by my workflow are not synching to the Exchange calendar.
I'm convinced I must be missing something extremely obvious but can't fathom it!
Resolved this now ... Appointments that are created by a workflow process exist in an "open" state (on our Dynamics instances - not sure if this has anything to do with instance settings) whereas manually created Appointments get a status of "scheduled" - it seems the "open" ones don't get synchronised with Exchange.
I couldn't find any settings / filters to specifically include open Appointments in the synchronisation, so instead I added a step in my workflow to set the Appointment status to "scheduled", which did the trick.

Managing identifiers when offline in an event sourced system

I have an event sourced system that runs on a server with clients that need to work offline from time to time. To make this work I have the domain events streamed from the server to the client when online so that the offline database is up to date in case the client goes offline. This works just fine.
When offline the user might add a new customer with the following sequence...
Add new customer command.
Customer aggregate added.
Customer aggregate creates initial appointment aggregate.
Query of read data returns new appointment details.
Command used to modify the appointment.
When back online I cannot reply the events for the server. Adding the new customer is fine but the resultant new appointment has an identifier I do not know about. So trying to replay the appointment update command fails because I have no idea what the correct appointment id should be.
Any ideas?
You need to review Greg Young's talk CQRS, not just for server systems.
Also Stack overflow question Occasionally Connected CQRS Systems, and the dddcqrs topic Merging Events in Occasionally Connected Clients.
I have no idea what the correct appointment id should be
Generate the ids when you generate the commands; you'll know what the appointment id is going to be, because you told the customer aggregate what id to use when creating the appointment.

post event to facebook with place page id

via the graph api, I create events for facebook pages I have the create_event and manage_pages privileges for.
I post to https://graph.facebook.com/pageId/events with the usual name, location, start_time, street, city parameters. Works perfectly.
However, I haven't found a way to submit a certain place_id for the event (e.g. FB-ID of the venue). This is possible using the web client. When creating an event, you can select a place/venue, the resulting event page shows that place on the map and links to the place page. Events created via the api only show the location name as text.
I tried place_page_id and several others as parameters, but nothing worked.
Has anybody done that successfully?
Thanks
Yes, you can. A poorly documented property of Event is location_id. Works fine.
The way I handle it is to search for type=place and if I find the place in the vast Facebook data store I use the id of that place in the location_id field. If I don't find the right place I use the information I have for street and city. (If you have location_id you really don't need street and city).
No with the current API it is not possible. Here's the only parameters for creating an event available. They are the same for user events as well as page events.
name (string)
start_time (timestamp)
end_time (timestamp)
description (string)
location (string)
privacy_type (string)