How to restore a Deleted Calendar Event Using Graph API
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với các lệnh gọi xóa của Graph SDK Java và truy vấn khôi phục mailFolders/messages được hiển thị trong issue. Xác định xem permanentDelete() và delete() có đặt các sự kiện lịch ở những vị trí khác nhau hay không, xác định endpoint hoặc ID thư mục Recoverable Items chính xác, và kiểm tra rằng có thể tìm thấy sự kiện để khôi phục.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
We are currently migrating functionality from EWS to Microsoft Graph API (Java). We have a requirement to delete and then programmatically restore calendar events. While our EWS implementation works perfectly, we are struggling to locate the deleted events using the Graph API.
Current EWS Implementation (Working)
In EWS, we use DeleteMode.HardDelete and then search the RecoverableItemsPurges folder to move the item back to the Calendar.
// How we delete meeting from calendar
if (msg instanceof MeetingMessage) {
MeetingMessage meetingMessage = MeetingMessage.bind(service, msg.getId());
ItemId masterId = meetingMessage.getAssociatedAppointmentId();
if (masterId != null) {
Appointment appointment = Appointment.bind(service, masterId);
appointment.delete(DeleteMode.HardDelete);
}
}
// How we restore the message
ItemView itemView = new ItemView(EwsServer.FOLDER_VIEW_PAGE_SIZE);
itemView.setTraversal(ItemTraversal.Shallow);
SearchFilter filterColl = new SearchFilter.SearchFilterCollection(
LogicalOperator.And,
new SearchFilter.IsEqualTo(ItemSchema.Subject, message.getSubject()),
new SearchFilter.IsEqualTo(EmailMessageSchema.Sender, message.getSender().getAddress())
);
FindItemsResults<Item> deletedItems = server.getExchangeService()
.findItems(WellKnownFolderName.RecoverableItemsPurges, filterColl, itemView);
if (deletedItems.getItems().size() > 0) {
for (Item item : deletedItems.getItems()) {
item.move(WellKnownFolderName.Calendar);
break;
}
}
Problem: Graph API Implementation (Not Working)
When using the Graph SDK, we cannot find the event in the recoverable items folders after a deletion.
Deletion code:
graphClient.users().byUserId(mailboxBeingScanned)
.calendar().events().byEventId(eventId)
.permanentDelete().post();
//we have tried delete method as this as well
graphClient.users().byUserId(mailboxBeingScanned)
.calendar().events().byEventId(eventId)
.delete();
Attempted recovery code:
We have tried searching recoverableitemspurges, deleteditems, and recoverableitemsdeletions using the internetMessageId, but the collection always returns empty.
MessageCollectionResponse eventMessage = graphClient.users().byUserId(mailboxBeingScanned)
.mailFolders().byMailFolderId("recoverableitemspurges")
.messages()
.get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "internetMessageId eq '<MN2PR13...prod.outlook.com>'";
});
Questions
-
When using permanentDelete() on a Calendar Event in Graph, does it land in a different folder than it would via EWS?
-
What is the correct mailFolderId or endpoint to query for items in the "Recoverable Items" partition specifically for Calendar events?
- Ngôn ngữ chính
- Java
- Star
- 447
- Fork
- 155
- Merge trung bình
- 23 giờ 41 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-java
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoftgraph/msgraph-sdk-java#2610 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoftgraph/msgraph-sdk-java#2678 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
microsoftgraph/msgraph-sdk-java#2654 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2639 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error in PATCH onlineMeetingĐang mởstatus:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-sdk-java#2589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoftgraph/msgraph-sdk-java
Issue tương tự
-
A CSV row that removes a language with #CLEAR and fills another name of it keeps one of themĐang mởbug level:trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
exoego/keycloak-fuhito#666 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ant-media/Ant-Media-Server#8185 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
desktop grp:about type:graphics-bug ui-public
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
EC2 SSH agent launch fails with NullPointerException when HTTP proxy has no password configuredĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jenkinsci/ec2-plugin#2051 ·