You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Solved] System.ArgumentException in ApnsConnection.Send() #1
System.ArgumentException in ApnsConnection.Send() happens sometimes when call apnsBroker.QueueNotification(apnsNotification); several thousends times in foreach loop
This happens likely because ApnsConnection.notifications Queue is not thread-safe
What are the steps required to reproduce this issue?
Please provide any Exception Stack Traces
System.ArgumentException: Source array was not long enough. Check the source index, length, and the array's lower bounds.
Parameter name: sourceArray
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
at System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
at System.Collections.Generic.Queue`1.Enqueue(T item)
at PushSharp.Apple.ApnsConnection.Send(CompletableApnsNotification notification)
at PushSharp.Apple.ApnsServiceConnection.Send(ApnsNotification notification)
changed the title [-]System.ArgumentException in ApnsConnection.Send()[/-][+][Solved] System.ArgumentException in ApnsConnection.Send()[/+]on Sep 19, 2019
Activity
IvoryRubble commentedon Sep 18, 2019
One suggestion is properly lock
notificationsQueue in ApnsConnection.Redth#672 (comment)
#2
IvoryRubble commentedon Sep 18, 2019
Another solution is replace
notificationQueue to ConcurrentQueueRedth#770
IvoryRubble commentedon Sep 19, 2019
Published nuget package with fix for this issue: https://www.nuget.org/packages/Actonica.PushSharp.Core/
This package deploys pull-request #2
[-]System.ArgumentException in ApnsConnection.Send()[/-][+][Solved] System.ArgumentException in ApnsConnection.Send()[/+]