SignalR client calls do not work for specific languages

I worked on a project for a client and got a lot of pleasure from integrating SignalR into the system.

Everything seems to work very well, and the client is really excited about how SignalR provides true real-time feedback for its application.

For the most part, everything went smoothly, but I ran into a strange problem that I just could not fix.

Everything works fine for the following locales:

  • EN-US
  • en GB
  • this is
  • P

However, these languages โ€‹โ€‹simply do not receive a callback from the hub:

  • fr
  • de
  • es
  • ru-ZW - we use English Zimbabwe to check the translation of all lines.

I can execute code all the way to Clients.Client(ConnectionId).update(Result); (where ConnectionId is the correct connection identifier, and Result is an object ready for serialization, the first four languages โ€‹โ€‹go flawlessly, and I get my Javascript method using the expected result.

However, in the last four languages, the method starts, but nothing happens on the other side. Nothing. Zip.

If I replace the Strings.fr.resx file with the default Strings.resx file, then my site will function as expected, but since the Strings.en-ZW.resx file is identical to Strings.resx (only each line is wrapped in [()]) I I doubt that this is a problem. I also tried using the fr locale with all unicode translations (`, รฉ, รข, etc.), but that didn't help.

I continued this almost the whole day and did not find anything that could indicate a problem, and the fact that en works fine, and en-ZW doesn't really bother 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(); 
+5
source share
1 answer

It turns out that the filtering system was not an agnostic of the language where it should have been, and I received false positives due to broken connections during debugging.

Now I feel completely stupid.

+2
source

Source: https://habr.com/ru/post/1235885/


All Articles