Azure / azure-notificationhubs-dotnet

.NET SDK for Azure Notification Hubs
MIT License
70 stars 119 forks source link

[BUG]The expiration date of Installation in Azure Notification Hub does not updated. #185

Open yuki-0310 opened 3 years ago

yuki-0310 commented 3 years ago

[Prerequisites and implementation procedures] The expiration date of the Installation is not updated after "NotificationHubClient.CreateOrUpdateInstallation()". The information is listed below.

(1)Prerequisite Vresion of NotificationHubClient:

region assembly Microsoft.Azure.NotificationHubs, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

// E:\ICF_AutoCapsule_disabled\SPApp_SOFT\main\nuget\packages\microsoft.azure.notificationhubs\4.0.0\lib\netstandard2.0\Microsoft.Azure.NotificationHubs.dll

endregion

(2)Implementation procedures Case 1 # Method instration of argument Retrieved ExpirationTime Remarks
1 CreateOrUpdateInstallation(Installation installition) InstallationId = "262c5d32-8154-48f6-a1f3-bcfb7b3a0c06",
ExpirationTime = System date + 2 hours,
Tags = ["ALL","PF:iOS","ID:120000524","USE:Registered"]
2 GetRegistrationsByChannelAsync(string token, int top).GetAwaiter().GetResult() 2020/11/19 20:30:00
3 CreateOrUpdateInstallation(Installation installition) InstallationId = "262c5d32-8154-48f6-a1f3-bcfb7b3a0c06",
ExpirationTime = System date + 2 hours,
Tags = ["ALL","PF:iOS","ID:120000524","USE:Registered"]
Set the same InstallationId as #1 -> ExpirationTime is assumed to be "updated"
4 GetRegistrationsByChannelAsync(string token, int top).GetAwaiter().GetResult() 2020/11/19 20:30:00 ExpirationTime is not updated in #3.
Case 2 Also update "Tags" in #3 # Method instration of argument Retrieved ExpirationTime Remarks
1 CreateOrUpdateInstallation(Installation installition) InstallationId = "262c5d32-8154-48f6-a1f3-bcfb7b3a0c06",
ExpirationTime = System date + 2 hours,
Tags = ["ALL","PF:iOS","ID:120000524","USE:Registered"]
2 GetRegistrationsByChannelAsync(string token, int top).GetAwaiter().GetResult() 2020/11/19 20:30:00
3 CreateOrUpdateInstallation(Installation installition) InstallationId = "262c5d32-8154-48f6-a1f3-bcfb7b3a0c06",
ExpirationTime = System date + 2 hours,
Tags = ["ALL","PF:iOS","ID:120000524","USE:Registered","test"]
Also updated "Tags"
4 GetRegistrationsByChannelAsync(string token, int top).GetAwaiter().GetResult() 2020/11/19 20:45:00 ExpirationTime is "updated" in #3

If you have also updated the Tags in #3, the ExpirationTime has been updated.

[Question] After updating the expiration date in above (2)Implementation procedures -> Case 1 -> # 3 of the Implementation procedures, could you tell me why the expiration date is not being renewed ?

bennoschoonraad commented 7 months ago

Bumping this issue - I have also ran into this issue.

A hacky work around seems to be to remove the Installation before calling CreateOrUpdateInstallation. I.E. first calling DeleteInstallationAsync It would be good to have some knowledge on how the Expiration Date works under the hood, since updating an existing installation does not seem to update the expiration date.