Improvements and small bug fix in List Webhooks extension methods#1233
Conversation
…d a valid delta when validity period is 6 months
|
@ypcode, |
|
Thanks Yannick, good change which I'll process. |
|
You are welcome. It is my pleasure to contribute |
|
I did have a peek at how we calculate the max expiration data and added some code snippet below. Can you adjust your PR to take today + 180 days as the max expiration. Internally we add a 90 minutes grace period to cater for time between the date being calculated and the webhook being added. internal const int expirationDateTimeMaxDays = 180;
internal const int expirationDateTimeGraceMinutes = 90;
DateTime utcNow = DateTime.UtcNow;
// Maximum expiration enforced by this API includes a grace period
DateTime maximumExpirationDateTime = utcNow
.AddDays(SPWebhookSubscriptionInformation.expirationDateTimeMaxDays)
.AddMinutes(SPWebhookSubscriptionInformation.expirationDateTimeGraceMinutes); |
|
Done. I also added 2 unit tests to verify the very last valid expiration and a barely invalid one |
|
Thanks. I've dropped the expirationDateTimeGraceMinutes from your code as we introduced that grace time for server side only. |
|
Oh OK, I missed it was only internal. Thanks for the merge.
|
What's in this Pull Request?