Concurrent requests to send emails will generate duplicate emails, and the number does not match.
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
- 25/100
Hướng nghiên cứu
Bắt đầu với điểm vào được cung cấp @PostMapping("/test") và GraphEmailSender.testInfo(), sau đó tái hiện 160 yêu cầu sendMail đồng thời bằng mã client Microsoft Graph đã cho. So sánh số lượng yêu cầu và số lượng thư được gửi thành công để xác định hành vi nằm trong SDK hay trong ứng dụng gọi. Hoàn tất khi xác định được một lỗi SDK có thể tái hiện kèm theo một kiểm thử tập trung, hoặc có bằng chứng rõ ràng rằng không cần thay đổi SDK.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello!
I used Postman to iterate 160 times to send emails, and actually received 160+ emails. The number of emails received is random and does not match the number, which means duplicate emails are generated.
@PostMapping("/test") public void SysEmailController() { GraphEmailSender.testInfo(); }
`
import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.microsoft.graph.models.EmailAddress;
import com.microsoft.graph.models.ItemBody;
import com.microsoft.graph.models.Message;
import com.microsoft.graph.models.Recipient;
import com.microsoft.graph.serviceclient.GraphServiceClient;
import com.microsoft.graph.users.item.sendmail.SendMailPostRequestBody;
import java.util.Collections;
import java.util.List;
public class GraphEmailSender {
// 配置参数
private static final String CLIENT_ID = "";
private static final String CLIENT_SECRET = "";
private static final String TENANT_ID = "";
private static final String SENDER_EMAIL = "";
private static final String[] SCOPES = new String[] { "https://graph.microsoft.com/.default" };
private static GraphServiceClient graphClient;
static {
try {
final ClientSecretCredential credential = new ClientSecretCredentialBuilder()
.clientId(CLIENT_ID)
.tenantId(TENANT_ID)
.clientSecret(CLIENT_SECRET)
.build();
if (null == credential) {
throw new Exception("Unexpected error");
}
graphClient = new GraphServiceClient(credential, SCOPES);
} catch (Exception e) {
System.err.println("init GraphServiceClient error: " + e.getMessage());
e.printStackTrace();
}
}
public static void testInfo() {
try {
Message message = new Message();
message.setSubject("test mail - Microsoft Graph API");
ItemBody body = new ItemBody();
body.setContent("Microsoft Graph API mail。");
message.setBody(body);
Recipient recipient = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.setAddress("");
recipient.setEmailAddress(emailAddress);
List<Recipient> recipients = Collections.singletonList(recipient);
message.setToRecipients(recipients);
SendMailPostRequestBody sendMailPostRequestBody =
new SendMailPostRequestBody();
sendMailPostRequestBody.setMessage(message);
//
graphClient.users()
.byUserId(SENDER_EMAIL)
.sendMail()
.post(sendMailPostRequestBody);
System.out.println("send success!"+Thread.currentThread());
} catch (Exception e) {
System.err.println("error: " + e.getMessage());
e.printStackTrace();
}
}
}`
- 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 ·