When I try to load conversations like so
CommunityServer.WebServices.Service svc = new Api.Service(SITEURL, APIUSER, APIKEY);
CommunityServer.WebServices.Membership.User user = svc.Membership.GetUser(APIUSER);
user.LoadAllConversations();
The resulting web request issued by the client library is
GET /api/membership.ashx/users/2100/conversations/?pageindex=0&pagesize=0 HTTP/1.1
Rest-User-Token: {ENCODED TOKEN}=
Host: localhost.
Connection: Close
The problem here is that the subsequent call to dbo.cs_Messaging_GetConversationIdsForParticipant carries @pageSize=0
to [dbo].[cs_system_CalculatePagingInformation] resulting in an error of
Msg 8134, Level 16, State 1, Procedure cs_system_CalculatePagingInformation, Line 19
Divide by zero error encountered.
Now, there are many possible fixes, but as far as I can tell, changing the line in cs_system_CalculatePagingInformation
from
@maxPageIndex = @maxValue / @pageSize
to
@maxPageIndex = @maxValue / COALESCE(NULLIF(@pageSize, 0), cast(0x7fffffff as int))
would fix the logic error in the paging calculation
My question is.... is there an existing patch for this bug?
If not, can I get an indication of intent? Particularly, was a pagesize of 0 in the paging calculation intended to mean "Give me everything"? Or is the bug in the client library in not correctly setting a pagesize or in cs_Messaging_GetConversationIdsForParticipant for not setting a pagesize?