I've been working on a project for a client and had a lot of fun integrating SignalR into the system.
Everything seems to work really well and the client is really excited about how the SignalR gives true real-time feedback for their application.
For the most part everything has gone swimmingly, however I've come into a strange issue I simply cannot pin down.
Everything works great for the following locales:
However these languages simply never get a callback from the hub:
I can step through the code right up until Clients.Client(ConnectionId).update(Result);
(where ConnectionId is the correct Connection ID, and Result is the object ready to be serialized, with the first four languages this goes flawlessly and I get my Javascript method with the expected output.
On the last four languages however, the method is fired, but nothing comes through to the other side. Nothing. Zip.
If I replace the Strings.fr.resx file with the default Strings.resx then my site functions as expected, but since the Strings.en-ZW.resx file is identical to Strings.resx (only each string is wrapped in [()]) I doubt that is the issue. I also tried using the fr locale with all unicode translations (`, é, â, etc) removed, but that didn't help.
I've been going over this for almost a full day now and found nothing that would indicate the issue, and the fact that en works fine and en-ZW does not really confuses me.
Anyone have any suggestions?
Hub method:
public class ClientHub : Hub
{
[...]
protected void UpdateRecords(List<Int32> ChangedValues)
{
using (var database = new DbContext())
{
foreach (Record R in database.Records.Where(Rc => ChangedValues.Contains(Rc.Id))
{
SignalRFormattedRecord Serialized = new SignalRFormattedRecord(Record);
foreach (SavedFilter Filter in SavedFilters.ByRecord(Record))
{
// Next line is always called.
Clients.Client(Filter.ConnectionId).updateRow(Serialized);
}
}
}
}
[...]
}
Javascript:
$.connection.clientHub.updateRow = function(value) {
debugger;
// update code works in all languages except FR, DE, ES and en-ZW.
}
$.connection.start();
Turns out the filtering system wasn't language agnostic where it should have been, and I was getting false positives due to dangling connections during debug.
I feel quite stupid now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With