HttpResponse - AutomaticDecompression in latest Xamarin

Just updated to latest xamarin and no pull request are working on my mobile app service (working fine before).
I can see that the HttpReponse now has an Gzipped content (System.Net.Http.DecompressionHandler.GZipDecompressedContent).  I believe this is caused by the AutomaticDecompression property of HttpResponse (also possibly by setting accepted encoding types on the HttpRequest originally?)
The problem is that there is a check in the code for the contentlength property which is NULL when automatic decompression is performed by HttpResponse.  The only workaround is to check the actual header directly (apiResponse.Headers["Content-Length"]) or turn off the accepted encoding on the original request apiRequest.Headers["Accept-Encoding"]
Here is the offending code in MobileServiceHttpClient.cs:
if (ensureResponseContent)
            {
                long? contentLength = null;
                if (response.Content != null)
                {
                    contentLength = response.Content.Headers.ContentLength;
                }

                if (contentLength == null || contentLength <= 0)
                {
                    throw new MobileServiceInvalidOperationException("The server did not provide a response with the expected content.", request, response);
                }
            }

Hi @jcbdev, thank you for reporting this. We will look into it.

I get the same exception "The server did not provide a response with the expected content" as @jcbdev using latest Xamarin with all packages updated
Note that Xamarin.iOS builds work fine, no exception thrown. The problem only shows on Xamarin.Android

Same issue with here. Android is a problem but iOS is fine.
Few other notes: The VS debugger is broken during debugging. The exception is null in the IDE but is clearly not. You can see the following code (in picture):

It is the ToListAsync() call that fires the exception.

For everyone experiencing problems, can you give the exact versions of Xamarin.Android and Visual Studio you're using?
For reference:

Xamarin releases
Visual studio versions

Microsoft Visual Studio Professional 2019
Version 16.3.0
VisualStudio.16.Release/16.3.0+29318.209
Microsoft .NET Framework
Version 4.8.03752
Installed Version: Professional
Visual C++ 2019   00435-60000-00000-AA131
Microsoft Visual C++ 2019
ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools
Application Insights Tools for Visual Studio Package   9.1.00913.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2019   16.3.282.33872
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019   16.3.282.33872
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0   16.3.282.33872
Azure App Service Tools v3.0.0
Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio   2.4.1000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools   16.3.282.33872
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio   2.4.1000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter   16.3.19252.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events
GitHub.VisualStudio   <IP_ADDRESS>63
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info
JustDecompilePackage2017 Extension   1.0
JustDecompilePackage2017 Visual Studio Extension Detailed Info
Microsoft Azure HDInsight Azure Node   2.4.1000.0
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service   2.4.1000.0
Language service for Hive query
Microsoft Azure Service Fabric Tools for Visual Studio   16.0
Microsoft Azure Service Fabric Tools for Visual Studio
Microsoft Azure Stream Analytics Language Service   2.4.1000.0
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1
Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager   2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio   16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.
Multilingual App Toolkit   4.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://aka.ms/matinstall
NuGet Package Manager   5.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Python   16.3.19252.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Python - Conda support   16.3.19252.1
Conda support for Python projects.
Python - Django support   16.3.19252.1
Provides templates and integration for the Django web framework.
Python - IronPython support   16.3.19252.1
Provides templates and integration for IronPython-based projects.
Python - Profiling support   16.3.19252.1
Profiling support for Python projects.
SQL Server Data Tools   16.0.61908.27190
Microsoft SQL Server Data Tools
Telerik ASP.NET Core VSExtensions   2019.3.910.1
Progress® Telerik® UI for ASP.NET Core Visual Studio extensions
ToolWindowHostedEditor   1.0
Hosting json editor into a tool window
TypeScript Tools   16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.4 for F# 4.6   16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6
Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers
Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes
VisualStudio.Mac   1.0
Mac Extension for Visual Studio
Xamarin   <IP_ADDRESS>4 (d16-3@06531f8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer   <IP_ADDRESS> (remotes/origin/d16-3-xcode11@bbe518670)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates   16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK   <IP_ADDRESS> (d16-3/8af1ca8)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
Xamarin.iOS and Xamarin.Mac SDK   <IP_ADDRESS> (5e8a208)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

I'm having this exact issue with Visual Studio for Mac.
Here are all my details:
=== Visual Studio Community 2019 for Mac ===
Version 8.3 (build 1805)
Installation UUID: af81f3cd-68a8-430f-b5e4-520fddf2417e
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac <IP_ADDRESS> (d16-3 / 08809f5b)
Package version: 604000198

=== Mono Framework MDK ===
Runtime:
Mono <IP_ADDRESS> (2019-06/fe64a4765e6) (64-bit)
Package version: 604000198
=== NuGet ===
Version: <IP_ADDRESS>92
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
2.1.701
2.1.700
2.1.505
2.1.504
2.1.302
2.1.301
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
2.1.13
2.1.12
2.1.11
2.1.9
2.1.8
2.1.2
2.1.1
2.0.5
2.0.0
=== Xamarin.Profiler ===
Version: <IP_ADDRESS>
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: <IP_ADDRESS> (Visual Studio Community)
Commit: xamarin-android/d16-3/8af1ca8
Android SDK: /Users/ronny/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.2
SDK Build Tools Version: 29.0.2
Build Information:
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/ronny/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_<IP_ADDRESS>
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: <IP_ADDRESS>
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:42:44 UTC
=== Android Device Manager ===
Version: <IP_ADDRESS>
Hash: 724ea69
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:43:06 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Apple Developer Tools ===
Xcode 11.0 (14936)
Build 11A420a
=== Xamarin.Mac ===
Version: <IP_ADDRESS> (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin.iOS ===
Version: <IP_ADDRESS> (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin Designer ===
Version: <IP_ADDRESS>
Hash: bbe518670
Branch: remotes/origin/d16-3-xcode11
Build date: 2019-09-17 18:39:30 UTC
=== Build Information ===
Release ID: 803001805
Git revision: df50511ccb08d4d84a53939f1d7fc0b40cbb0ee1
Build date: 2019-09-20 16:10:55+00
Build branch: release-8.3
Xamarin extensions: da8d448cd65f2cc87c5e6dc7e2c2ca7b96d20c72
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Thu Jun 20 18:42:21 PDT 2019
root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64

I am having the issue as well:
=== Visual Studio Community 2019 for Mac ===
Version 8.3 (build 1805)
Installation UUID: 19c8c2b2-2db0-4590-9a3a-ba50296def4f
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac <IP_ADDRESS> (d16-3 / 08809f5b)
Package version: 604000198
=== Mono Framework MDK ===
Runtime:
Mono <IP_ADDRESS> (2019-06/fe64a4765e6) (64-bit)
Package version: 604000198
=== NuGet ===
Version: <IP_ADDRESS>92
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
2.1.701
2.1.700
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
2.1.13
2.1.12
2.1.11
=== Xamarin.Profiler ===
Version: <IP_ADDRESS>
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 11.0 (14936)
Build 11A420a
=== Xamarin.Mac ===
Version: <IP_ADDRESS> (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin.iOS ===
Version: <IP_ADDRESS> (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin Designer ===
Version: <IP_ADDRESS>
Hash: bbe518670
Branch: remotes/origin/d16-3-xcode11
Build date: 2019-09-17 18:39:30 UTC
=== Xamarin.Android ===
Version: <IP_ADDRESS> (Visual Studio Community)
Commit: xamarin-android/d16-3/8af1ca8
Android SDK: /Users/jnorton/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 28.0.3
Build Information:
Mono: mono/mono@7af64d1
Java.Interop: xamarin/java.interop@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools@cb41333
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/jnorton/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_<IP_ADDRESS>
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: <IP_ADDRESS>
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:42:44 UTC
=== Android Device Manager ===
Version: <IP_ADDRESS>
Hash: 724ea69
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:43:06 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 803001805
Git revision: df50511ccb08d4d84a53939f1d7fc0b40cbb0ee1
Build date: 2019-09-20 16:10:55+00
Build branch: release-8.3
Xamarin extensions: da8d448cd65f2cc87c5e6dc7e2c2ca7b96d20c72
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Tue Aug 20 16:57:14 PDT 2019
root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Could it be related to either of these issues?

https://github.com/mono/mono/issues/16950

https://github.com/xamarin/xamarin-android/issues/3626

This does look suspiciously similar to https://github.com/xamarin/xamarin-android/issues/3626 to me.
If anyone on this issue gets a chance to try the following candidate workaround and reply back with whether that resolves the issue, that would be perfect. Thanks!
Candidate workaround:
Add a new linker.xml file to the Xamarin.Android app project, set the Build Action to LinkDescription, and add the following lines to it to preserve the AndroidClientHandler type:
<linker>
  <assembly fullname="Mono.Android">
    <type fullname="Xamarin.Android.Net.AndroidClientHandler" preserve="all" />
  </assembly>
</linker>

@brendanzagaeski  I tried it. Didn't work.

I also tried it, and it didn't work for me either.

Darn. Thanks for testing! I'll do a little more investigation from the Xamarin.Android side to see if I can help track down whether the fix will need to be in Xamarin.Android or in the Azure Mobile Apps .NET client SDK.

I also have this issue, here are my details:
=== Visual Studio Community 2019 for Mac ===
Version 8.3 (build 1805)
Installation UUID: 644a6e7b-b593-41de-8f6c-f4f1bbcddda3
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac <IP_ADDRESS> (d16-3 / 08809f5b)
Package version: 604000198

=== Mono Framework MDK ===
Runtime:
Mono <IP_ADDRESS> (2019-06/fe64a4765e6) (64-bit)
Package version: 604000198
=== NuGet ===
Version: <IP_ADDRESS>92
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
3.0.100-rc1-014190
2.1.701
2.1.700
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
3.0.0-rc1-19456-20
2.1.13
2.1.12
2.1.11
=== Xamarin.Profiler ===
Version: <IP_ADDRESS>
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: <IP_ADDRESS> (Visual Studio Community)
Commit: xamarin-android/d16-3/8af1ca8
Android SDK: /Users/paololeva/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.4
SDK Build Tools Version: 28.0.3
Build Information:
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/paololeva/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_<IP_ADDRESS>
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: <IP_ADDRESS>
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:42:44 UTC
=== Android Device Manager ===
Version: <IP_ADDRESS>
Hash: 724ea69
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:43:06 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Apple Developer Tools ===
Xcode 11.0 (14936)
Build 11A420a
=== Xamarin.Mac ===
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
=== Xamarin.iOS ===
Version: <IP_ADDRESS> (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin Designer ===
Version: <IP_ADDRESS>
Hash: bbe518670
Branch: remotes/origin/d16-3-xcode11
Build date: 2019-09-17 18:39:30 UTC
=== Build Information ===
Release ID: 803001805
Git revision: df50511ccb08d4d84a53939f1d7fc0b40cbb0ee1
Build date: 2019-09-20 16:10:55+00
Build branch: release-8.3
Xamarin extensions: da8d448cd65f2cc87c5e6dc7e2c2ca7b96d20c72
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Tue Aug 20 16:57:14 PDT 2019
root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Cross-referencing link for the Microsoft team to the corresponding Developer Community item:
https://developercommunity.visualstudio.com/content/problem/696459/visual-studio-preview-2-163-xamarin-android-app-er.html

I dug into this a bit more, and it looks like jcbdev's original description pinpointed the cause of the issue very nicely.
It turns out that the reason Xamarin.Android <IP_ADDRESS> hits this issue is that it now correctly sets the the Accept-Encoding header to gzip on the outbound request when AutomaticDecompression is set to DecompressionMethods.GZip. Xamarin.Android <IP_ADDRESS> did not correctly set that request header.
The Azure Mobile Apps .NET client SDK sets AutomaticDecompression to DecompressionMethods.GZip in:
https://github.com/Azure/azure-mobile-apps-net-client/blob/4.1.1/src/Microsoft.Azure.Mobile.Client/Http/MobileServiceHttpClient.cs#L683-L686
As jcbdev correctly noted:

the contentlength property ... is NULL when automatic decompression is performed by HttpResponse

I confirmed this quickly in a little .NET Core console app:
using System;
using System.Net;
using System.Net.Http;

class Program
{
    static void Main(string[] args)
    {
        var handler = new HttpClientHandler();
        handler.AutomaticDecompression = DecompressionMethods.GZip;
        var client = new HttpClient(handler);
        HttpResponseMessage response = client.GetAsync("https://www.bing.com").Result;
        Console.WriteLine(response.Content.Headers.ContentLength?.ToString() ?? "null");
    }
}

This prints null. If the AutomaticDecompression line is commented out, it prints a number instead.
I also confirmed that Xamarin.Android <IP_ADDRESS> was able to run the Xamarin.Android quickstart example correctly if I changed ensureResponseContent to false in the lines jcbdev mentioned. So it looks like the fix for this issue will indeed be to adjust the MobileServiceHttpClient implementation to expect null for the ContentLength when using DecompressionMethods.GZip.

Temporary workaround
Either:

Pass in an HttpClientHandler instance in the call to new MobileServiceClient(). Example patch for the quickstart sample:
-client = new MobileServiceClient(applicationURL);
+client = new MobileServiceClient(applicationURL, new HttpClientHandler());

The Azure Mobile Apps .NET client SDK will not automatically set DecompressionMethods.GZip on the HttpClientHandler when the app provides its own in the call to new MobileServiceClient(), so this will restore the behavior as seen with Xamarin.Android <IP_ADDRESS>.

OR pass in an instance of AndroidClientHandler. Example patch for the quickstart sample:
-client = new MobileServiceClient(applicationURL);
+client = new MobileServiceClient(applicationURL, new Xamarin.Android.Net.AndroidClientHandler());

This option can potentially also improve the performance of the HTTP requests because AndroidClientHandler directly leverages the Android OS HTTP stack.

Nice workaround @brendanzagaeski.
I've been using a temporary version I built myself with the response.ContentLength property check changed to check response.Content.Headers["Content-Length"] instead which isn't null.
It's not the actual content length as it's the length of the compressed gzip stream but I believe the check is to determine there is any content at all which this revised check would do.  I could submit a PR later if that's the agreed way of resolved it?
from memory (not at my machine currently)
I have changed this:
contentLength = response.Content.Headers.ContentLength;
to this:
contentLength = response.Content.Headers["Content-Length"];

@annakocheshkova and @jwallra  Now that this has been investigated and the root issue identified, can we get an updated nuget for Azure Mobile Client that includes a fix for this?

@brendanzagaeski Thanks so much for digging in to find the root cause of this issue!

@brendanzagaeski Thank you for your investigation and workaround! ❤
I'm going to talk with the team today and see if it's possible to release an SDK update.  Ideally we would be able to mitigate the need for the workaround.

@brendanzagaeski Thanks Brendan, I tried the work around and we were 5/5 for doing a complete sync with the HttpClientHandler() with no issues.
Just a note, we are (were) passing in a DelegateHandler to the MobileServiceClient constructor. Hopefully an SDK update will come up and we can stick with our current code per @jwallra comment above.

To apply the workaround AND keep custom delegate handler working, just add this to your handler constructor:
public MyCustomDelegatingHandler() : base(new HttpClientHandler()) { }
Best of both world :)

After testing the work around, I'm finding that performing a sync across all my tables is about 33% slower. @jwallra we really do need a proper SDK update here that will properly address this situation. What did the team decide?

@jcbdev Would you please share the actual code change you made to get the Content-Length value from the header? I think a change in the client is the best way to go.

After testing the work around, I'm finding that performing a sync across all my tables is about 33% slower. @jwallra we really do need a proper SDK update here that will properly address this situation. What did the team decide?

I am not sure it is the handler is the cause of slowing it down. Since we updated we have seen a large decrease in performance across the board (all three platforms).

@ronnyhash @RetrotecEd @jwallra @brendanzagaeski
I don't have my vm with all the correct dependencies installed to build this and test it but it's the same as the version I created for myself before so I believe it should work to resolve this issue.  If someone is able to test it, merge it and release a new nuget then it should solve the issue permanently!
Thanks for your help.
https://github.com/Azure/azure-mobile-apps-net-client/pull/515

@brendanzagaeski Hi Brendan, I am having the same issue. What else do I need to do to make this work please?
I am creating my mobile service client like this:
public static MobileServiceClient MobileServiceAndroid =
new MobileServiceClient(AppConstants.AZURE_PRODUCTION_WEB_API_URL, new HttpClientHandler());
Then tried to pull from the table like this:
if (Device.RuntimePlatform == Device.Android)
{
regionList = await App.MobileServiceAndroid.GetTable<Models.Region>().ToListAsync();
}
else
{
regionList = await App.MobileService.GetTable<Models.Region>().ToListAsync();
}
But I assume there's a delegate class to create? Please advise how to fix this. I am still getting the error mentioned above.

Still experiencing this issue.
`Microsoft Visual Studio Community 2019
Version 16.3.1
VisualStudio.16.Release/16.3.1+29324.140
Microsoft .NET Framework
Version 4.7.03056
Installed Version: Community
Application Insights Tools for Visual Studio Package   9.1.00913.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2019   16.3.283.64955
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019   16.3.283.64955
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0   16.3.283.64955
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools   16.3.283.64955
Azure Functions and Web Jobs Tools
C# Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1
Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager   2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Mono Debugging for Visual Studio   16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager   5.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
SQL Server Data Tools   16.0.61908.27190
Microsoft SQL Server Data Tools
TypeScript Tools   16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.4 for F# 4.6   16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6
Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers
VisualStudio.Mac   1.0
Mac Extension for Visual Studio
Xamarin   <IP_ADDRESS>4 (d16-3@06531f8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer   <IP_ADDRESS> (remotes/origin/d16-3-xcode11@bbe518670)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates   16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK   <IP_ADDRESS> (d16-3/8af1ca8)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
Xamarin.iOS and Xamarin.Mac SDK   <IP_ADDRESS> (5e8a208)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.`
@jwallra can we expect an update any time soon?

@RazvanEmilR, interesting. If your app was previously using a subclass of DelegatingHandler, then with a bit of luck, the approach JeremyBP mentioned might help:
JeremyBP commented on Sep 28 https://github.com/Azure/azure-mobile-apps-net-client/issues/514#issuecomment-536186635

To apply the workaround AND keep custom delegate handler working, just add this to your handler constructor:
public MyCustomDelegatingHandler() : base(new HttpClientHandler()) { }
Best of both world :)

Another thing you could try just to help rule out anything unexpected could be to set AutomaticDecompression explicitly when creating the HttpClientHandler:
public static MobileServiceClient MobileServiceAndroid =
new MobileServiceClient(AppConstants.AZURE_PRODUCTION_WEB_API_URL, new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.None });

Lastly, it looks like RefreshUserAsync(), LoginAsync(), and LoginWithMicrosoftAccountAsync() are special because they don't use the HttpClientHandler passed to the MobileServiceHttpClient constructor. If your app uses one of those, then I think unfortunately there isn't a way to work around the issue without building your own Microsoft.Azure.Mobile.Client.dll.

"The server did not provide a response with the expected content" in Android platform.
But in UWP it work well, any solution please ?

what should I do here ?
class AuthenticationDelegatingHandler : DelegatingHandler
    {
        protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            // Clone the request, in case we need to re-issue it
            var clone = await CloneHttpRequestMessageAsync(request);
            // Now do the request
            var response = await base.SendAsync(request, cancellationToken);

            if (response.StatusCode == HttpStatusCode.Unauthorized)
            {
                // The request resulted in a 401 Unauthorized.  We need to do a LoginAsync,
                // which will do the Refresh if appropriate, or ask for credentials if not.
                var user = await ServiceLocator.Instance.Resolve<ICloudService>().LoginAsync();

                // Now, retry the request with the cloned request.  The only thing we have
                // to do is replace the X-ZUMO-AUTH header with the new auth token.
                clone.Headers.Remove("X-ZUMO-AUTH");
                clone.Headers.Add("X-ZUMO-AUTH", user.MobileServiceAuthenticationToken);
                response = await base.SendAsync(clone, cancellationToken);
            }

            return response;
        }

        /// <summary>
        /// Clone a HttpRequestMessage
        /// Credit: http://stackoverflow.com/questions/25044166/how-to-clone-a-httprequestmessage-when-the-original-request-has-content
        /// </summary>
        /// <param name="req">The request</param>
        /// <returns>A copy of the request</returns>
        public static async Task<HttpRequestMessage> CloneHttpRequestMessageAsync(HttpRequestMessage req)
        {
            HttpRequestMessage clone = new HttpRequestMessage(req.Method, req.RequestUri);

            // Copy the request's content (via a MemoryStream) into the cloned object
            var ms = new MemoryStream();
            if (req.Content != null)
            {
                await req.Content.CopyToAsync(ms).ConfigureAwait(false);
                ms.Position = 0;
                clone.Content = new StreamContent(ms);

                // Copy the content headers
                if (req.Content.Headers != null)
                    foreach (var h in req.Content.Headers)
                        clone.Content.Headers.Add(h.Key, h.Value);
            }

            clone.Version = req.Version;

            foreach (KeyValuePair<string, object> prop in req.Properties)
                clone.Properties.Add(prop);

            foreach (KeyValuePair<string, IEnumerable<string>> header in req.Headers)
                clone.Headers.TryAddWithoutValidation(header.Key, header.Value);

            return clone;
        }
    }

@XamarinTounsi Add a new constructor like this:
public AuthenticationDelegatingHandler() : base(new HttpClientHandler()) { }

 public AuthenticationDelegatingHandler() : base(new HttpClientHandler())

        {

        }
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            // Clone the request, in case we need to re-issue it
            var clone = await CloneHttpRequestMessageAsync(request);
            // Now do the request
            var response = await base.SendAsync(request, cancellationToken);

            if (response.StatusCode == HttpStatusCode.Unauthorized)
            {
                // The request resulted in a 401 Unauthorized.  We need to do a LoginAsync,
                // which will do the Refresh if appropriate, or ask for credentials if not.
                var user = await ServiceLocator.Instance.Resolve<ICloudService>().LoginAsync();

                // Now, retry the request with the cloned request.  The only thing we have
                // to do is replace the X-ZUMO-AUTH header with the new auth token.
                clone.Headers.Remove("X-ZUMO-AUTH");
                clone.Headers.Add("X-ZUMO-AUTH", user.MobileServiceAuthenticationToken);
                response = await base.SendAsync(clone, cancellationToken);
            }

            return response;
        }

        /// <summary>
        /// Clone a HttpRequestMessage
        /// Credit: http://stackoverflow.com/questions/25044166/how-to-clone-a-httprequestmessage-when-the-original-request-has-content
        /// </summary>
        /// <param name="req">The request</param>
        /// <returns>A copy of the request</returns>
        public static async Task<HttpRequestMessage> CloneHttpRequestMessageAsync(HttpRequestMessage req)
        {
            HttpRequestMessage clone = new HttpRequestMessage(req.Method, req.RequestUri);

            // Copy the request's content (via a MemoryStream) into the cloned object
            var ms = new MemoryStream();
            if (req.Content != null)
            {
                await req.Content.CopyToAsync(ms).ConfigureAwait(false);
                ms.Position = 0;
                clone.Content = new StreamContent(ms);

                // Copy the content headers
                if (req.Content.Headers != null)
                    foreach (var h in req.Content.Headers)
                        clone.Content.Headers.Add(h.Key, h.Value);
            }

            clone.Version = req.Version;

            foreach (KeyValuePair<string, object> prop in req.Properties)
                clone.Properties.Add(prop);

            foreach (KeyValuePair<string, IEnumerable<string>> header in req.Headers)
                clone.Headers.TryAddWithoutValidation(header.Key, header.Value);

            return clone;
        }

In AzureCloudService i have added this
 public AzureCloudService()
        {
            Client = new MobileServiceClient(Locations.AppServiceUrl, new AuthenticationDelegatingHandler(), new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.None });
            if (Locations.AlternateLoginHost != null)
            {
                Client.AlternateLoginHost = new Uri(Locations.AlternateLoginHost);
            }
            PlatformProvider = DependencyService.Get<IPlatformProvider>();
            if (PlatformProvider == null)
            {
                throw new InvalidOperationException("No Platform Provider");
            }
        }
````
Still not work in Android Platform

@XamarinTounsi Since you already have a HttpClientHandler in the constructor of the MobileServiceClient, you don't need the constructor in the DelegatingHandler.
Does it still give the exact same error or did it change?
Make sure the HTTP request also doesn't contain a Accept-Encoding: GZip since that could trigger the same bug as xamarin/xamarin-android#3626.
Also make sure your Visual Studio version is 16.3.3+ to fix issue Mono/Mono#16950.
This issue is one big rabbithole that went wrong on multiple levels...

Now i have this error, "You must pass in a corretly formated url".

to avoid all doubts, i have added a Linker.xml file
<?xml version="1.0" encoding="utf-8" ?>
<linker>
  <assembly fullname="Mono.Android">
    <type fullname="Xamarin.Android.Net.AndroidClientHandler" preserve="all" />
  </assembly>
</linker>

in csproj, i have added
<ItemGroup>
  <LinkDescription Include="YourLinkDescriptionFileName.xml" />
</ItemGroup>

i did like @brminnick

Still same error ...

Same error here after upgrading to VS 16.3 and Xamarin.Android 10.0, at this moment I'm using VS 16.3.4 and Xamarin.Android <IP_ADDRESS> and the issue is still happening.

Any updates on this? What is the solution after all?

@RazvanEmilR @asierpn @XamarinTounsi
I submitted a pull request for this to fix in this nuget package but had no reply or anything ?!?
(PR here -> https://github.com/Azure/azure-mobile-apps-net-client/pull/515).
I tried ¯\(ツ)/¯
There is another workaround for anyone who controls the api end.  I probably wouldn't recommend this but if you are struggling as some of my mobile teams are then this has been used to work around it.
This avoids gzip entirely so should give the same performance as the original behaviour.
Web Api (Global.asax.cs)
protected void Application_BeginRequest(object sender, EventArgs e)
{
    try
    {
        HttpContext.Current.Request.Headers["Accept-Encoding"] = "";
    }
    catch(Exception){}
}

.net core (middleware)
public class RemoveGzipRequestContentEncodingMiddleware
{
    public RemoveGzipRequestContentEncodingMiddleware(RequestDelegate next)
    {
        if (next == null)
            throw new ArgumentNullException(nameof(next));

        this.next = next;
    }

    private readonly RequestDelegate next;
    private const string ContentEncodingHeader = "Content-Encoding";

    public async Task Invoke(HttpContext context)
    {
        if (context.Request.Headers.Keys.Contains(ContentEncodingHeader))
        {
            var contentEncoding = context.Request.Headers[ContentEncodingHeader];
            context.Request.Headers.Remove(ContentEncodingHeader);
        }

        await next(context);
    }
}

@RazvanEmilR the only solution at this time for us is keep using VS 16.2.4 to work with Azure Mobile App from Xamarin.Android

i had this error now, Error loading items: You must pass in a corretly formated url.

Before upgrading it work perfectly ? why

It seems that the bug was introduced in Xamarin.Android 10.0 which is included in VS 16.3, if you revert to VS 16.2 you will avoid this issue.

The problem is present on all platforms not just in Android

In our case the issue is only happening from Xamarin.Android, Xamarin.iOS and UWP are working fine after upgrading to 16.3 as @PaoloLeva commented.

When will an official fix be pushed out.  I know that @jcbdev has a PR with a resolution, why hasn't anyone acted on this yet?

@dhei please review this thread and consider merging @jcbdev 's pull request.

looks like #515 is waiting to go.

Hey folks,
Sorry for the delay in response.
We plan to release a fix for this issue and we will share the ETA of the release as soon as we have one.

Hey @dhei, I recognize that there are processes required in order to get a release out the door, but I'm wondering if there is anything we can do in the mean time in order to remove the impediment.
For myself, I've done exactly what was described above, but it has not circumvented the issue
        public AuthenticationDelegatingHandler(
            IAuthService authService,
            IVersionTracking versionTracking):base(new HttpClientHandler())
        {

@dhei Any Updates????

What is the status of the release, I see the PR has been approved but not merged.  Can we get a time frame to work with as far as fixing this issue?

@dhei, I don't believe this is something y'all should just be sitting on. With no easy rollback option with Visual Studio, the only path is a path forward. This is now a major impediment that needs addressing. Please escalate this issue and get it resolved!

Microsoft want to promote App Center Data now, and they don't want to give support to this library anymore. If you look into the azure portal they have remove the option to create Mobile App Service as well.
These people are really crazy, at some point of time they will stop App Center Data as well. Who knows how long they even support Xamarin..... Ridiculous  :/

@stezma technology will always be deprecated and replaced. This is a fact of progress. I'm perfectly ok with them stopping new feature development on this product... what we do need however is critical fixes and maintenance releases for a period of time after support is dropped.

Apologies for the delayed respond and all the inconvenience this is causing. You all have raised some valid points and I will make sure your voices gets heard within Microsoft. We definitely need to get better in migrating people from one platform to another.  As for this issue, we do plan to fix it but the release/shipment is expected to happen by December. And while we have fixed the issue, we still have to do some testing before we release the SDK.

As for this issue, we do plan to fix it but the release/shipment is expected to happen by December
yikes!

as I said before, MS has made it really difficult to roll back our environments once they're updated, so a breaking change like this become orders of magnitude more difficult to mitigate.

@ChaseFlorell Thanks for the note! I will keep on pushing to release it early! I have shared the tentative plan but hopefully we will try to get it release early.

@ahbilal-ms Are you seriously suggesting it will take another month?  I think you'll find lots of people are affected by this and losing money in wasted time and customers.  There are live systems using this library!
What else is in this next release that needs such extensive and testing and quality control that you can't release a pre-release package immediately? Wouldn't it be more efficient to release it as a prerelease package and let us (the community) test it for you?
I think I am not the only person experiencing major frustration with the response to this issue.  Especially as I highlighted the exact bug (and lines of code) in the first post on the 24th September.

@ChaseFlorell I am also asking the same thing. Why there is no support.
MS is making things deprecated only for looting money. What extra feature / security they have introduced in App Center Data?
It is still buggy and not matured enough to replace  Azure Mobile Apps.

We use Azure Mobile Apps to connect to various on-premises SQL databases and we use also offline sync, I think that App Center Data is far to provide such features so Azure Mobile Apps can not be deprecated until Microsoft give us an alternative service and migration instructions.

We use Azure Mobile Apps to connect to various on-premises SQL databases and we use also offline sync, I think that App Center Data is far to provide such features so Azure Mobile Apps can not be deprecated until Microsoft give us an alternative service and migration instructions.

This, 100%.
It's very concerning that MS have dropped Azure Mobile Apps like a hot stone, without providing adequate alternatives, instruction, or support. Especially as so many of us are experiencing this issue in a production environment.
@ahbilal-ms Is there really no cause here to fast-track this release?

@ahbilal-ms These are very good points from @Bejasc and @asierpn I think should be considered harder.  I think you may be underestimating the impact to companies relying on this library which cannot just switch on a whim.
It's my understanding as well that App Center Data is still in preview and it forces you to use cosmos db which not every application can be moved to trivially. Especially as intergrations with other platforms for cosmos db is still lacking in many areas (The terrible Power BI connector comes to mind which you can't even use on powerbi.com).

It's my understanding as well that App Center Data is still in preview and it forces you to use cosmos db which not every application can be moved to trivially.

This in particular is why MS stance on this is concerning me. We've already migrated over from MySql to SQL Server a little over 18 months ago, just so that we could use this library. It took us a good 6 months to prepare, build, and fully test for the data migration alone, let alone the time taken (and still taken, with other issues we are dealing with in this library), it damn near killed our product.
The idea of having to go through that process again so soon, just so that we can continue using supported tech - is frightening.

Thanks for sharing your concerns. I will escalate this issue to the highest level and will come back to you with an update by end of day. Thanks

@ahbilal-ms Does Microsoft seriously expect people to transition from table controllers to a App Center Data implementation? Like others in this issue, we have the azure apps sdk deployed in production that services a large number of clients, can can't just change a core aspect of our stack. What confidence can Microsoft provide that the same fate won't happen to App Center Data services?

@ahbilal-ms how did the escalation go?

Hey All! I did escalate the issue but we are still looking at the timeline of early December for the SDK release. I understand the frustration and concerns that many of you have raised but considering the backlog of work we have, it is difficult to commit anything before December. The team however is committed to resolve this and other issues associated with Azure Mobile Services. Also, I will keep on pushing the team on this issue and if we do find any opportunity to fix it earlier, we will definitely do that.

@brendanzagaeski
I have created a Dependency Service in Platform level
Android
 public HttpMessageHandler GetHttpHandler()
 {
     return new AndroidClientHandler();
 }

IOS
 public HttpMessageHandler GetHttpHandler()
 {
      return new NSUrlSessionHandler();
 }

And in Forms I am assigning the handler like this

 var handler = PlatformHandler.GetHttpHandler() ?? new HttpClientHandler();
 Client = new MobileServiceClient(_config.AzureMobileServiceUri.AzureMobileAppUri, handler);

All the happy flow scenarios it is working fine. But in the workaround you provided, it has mentioned that
These workarounds won't fully resolve the issue for apps that use the RefreshUserAsync(), LoginAsync(), or LoginWithMicrosoftAccountAsync() method of MobileServiceHttpClient because those methods use their own HttpClientHandler instance rather than the one passed into the constructor.
So my doubt is,
In my app I am calling the LoginAsync() method, Is it going to fail at any circumstances? If yes what I can do to fix it?
Client?.LoginAsync(MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory, objToken);

In my app I am calling the LoginAsync() method, Is it going to fail at any circumstances? If yes what I can do to fix it?

As a caution, I'm not an expert on the Azure Mobile Apps .NET client SDK. That caution out of the way, the background for my comment about LoginAsync() is that I looked at the call path through the following methods:

MobileServiceClient.LoginAsync()
MobileServiceAuthentication.LoginAsync()
MobileServiceTokenAuthentication.LoginAsyncOverride()
MobileServiceHttpClient.RequestWithoutHandlersAsync()
MobileServiceHttpClient.RequestAsync(), with a value of false in the UseHandlers parameter, and a value of false in the ensureResponseContent parameter
The initialization of MobileServiceHttpClient.httpClientSansHandlers
MobileServiceHttpClient.DefaultHandlerFactory()
MobileServiceHttpClient.GetDefaultHttpClientHandler()

Based on my reading of that call path, MobileServiceClient.LoginAsync() will always use an HttpClientHandler instance that has HttpClientHandler.AutomaticDecompression set to DecompressionMethods.GZip in Xamarin.Android applications because HttpClientHandler.SupportsAutomaticDecompression will be true at https://github.com/Azure/azure-mobile-apps-net-client/blob/4.1.1/src/Microsoft.Azure.Mobile.Client/Http/MobileServiceHttpClient.cs#L683.
But I think when I originally looked at this a few weeks ago I missed the detail that ensureResponseContent is false at step 5. When ensureResponseContent is false, the code path that checks the value of response.Content.Headers.ContentLength and throws MobileServiceInvalidOperationException will be skipped, and the login will proceed successfully.
Given this reassessment, I think my comment about limitations for RefreshUserAsync(), LoginAsync(), and LoginWithMicrosoftAccountAsync() can be ignored. I think all of those methods will work.

Anyone update us with a release time for this month?

@norton287 I would like to know as well.

This is in active development and the team is expected to release the SDK any time in the next few days. I will get an another update in the morning and will post it here.

@ahdbilal can you please provide an update as mentioned?

This work is now completed and has been shipped in v4.1.2 of the client. These can be accessed from the below link:
https://github.com/Azure/azure-mobile-apps-net-client/releases/tag/4.1.2
https://www.nuget.org/packages/Microsoft.Azure.Mobile.Client/4.1.2
https://www.nuget.org/packages/Microsoft.Azure.Mobile.Client.SQLiteStore/4.1.2

Thank you!!!

Thanks, new package version works, but it does not compile in Azure CI for some reason, see attached logs
errLog.txt

Hi @devperson,
This method (from your logs), hasn't been changed in this release. Please open separate issue because it's unrelated to this one. Thanks.

This error is back.  Perhaps the headers from the server have changed.
Wouldn't it be better/easier to inspect the content later?  Perhaps in the GetResponseContent method?  I don't think there would be any downstream issues since the other methods calling the SendRequestAsync method have ensureResponseContent set to false.
Or maybe some fancier handling when the content type is application/json.
    private static async Task<string> GetResponseContent(HttpResponseMessage response)
    {
        string responseContent = null;
        if (response.Content != null)
        {
            responseContent = await response.Content.ReadAsStringAsync();
        }

        if (responseContent == null)
        {
            throw new Exception("The server did not provide a response with the expected content.");
        }
        return responseContent;
    }

Hi @FlxGen ,
is it possible to provide more details about the error? I mean maybe there are exact repro steps?
Also, here we have workarounds https://github.com/Azure/azure-mobile-apps-net-client/issues/514/#issuecomment-535297742 . These workarounds are work for you?
I'm interested in why you wrote only about JSON type?
Am I right that the main problem is that 'response.Content' is null in several cases (the fix was provided for the case when 'response.Headers.ContentLength' is null)?
Thanks.

I am wondering if this bug was ever away.
The combination VS 16.2.3 and Mobile Service Client 4.1.1 works fine, as in August/September 2019. If I make a little upgrade step to VS 16.3.0 in combination with Mobile Service Client 4.1.1 the exception "The server did not provide a response with the expected content." shows up. That was expectable.
If I update to Mobile Service Client 4.1.2 the exception is still there. (In detail: Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: The server did not provide a response with the expected content.  at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.SendRequestAsync).
The fix #526 „Fix the validation of HTTP responses with AutomaticDecompression enabled“ in MobileServiceHttpClient.cs is most likely without effect.
Let’s review the code changes for fix #526 in azure-mobile-apps-net-client/src/Microsoft.Azure.Mobile.Client/Http/MobileServiceHttpClient.cs (and we keep in mind that the http-response with compression and contentLength = null caused the exception):
First IsDecompressionUsed(HttpRequestMessage request) detects the compression state. By the way: Why is this determined by the request header and not by the response header? Even if the client sends "Accept-Encoding" the server may choose not to compress the response and the result from IsDecompressionUsed is wrong.
Anyway, when we assume that a compression is used we can never run in code line 638 to 645 to raise the exception. I didn't get the trick yet, see here:
bool decompressionUsed = IsDecompressionUsed(request);

if (!decompressionUsed && response.Content != null)
{
	long? contentLength = response.Content.Headers.ContentLength;
	if (contentLength == null || contentLength <= 0)
	{
		throw new MobileServiceInvalidOperationException("The server did not provide a response with the expected content.", request, response);
	}
}

The only conclusion would be that the result from IsDecompressionUsed is wrong and contentLength = null or response.Content.Headers.ContentLength crashes.
Unfortunately without code acrobatics it is not possible to inspect the HTTPS-Traffic from an Android-Device due to MobileServiceHttpClient is bypassing the Fiddler-proxy so I can´t deliver any traffic details. If I look in the network traces in the mobile service backend, I would say compression is used and content length is set.
When I use the backend with Postman and play around with the encoding, the content length is always set.
I guess the JSON thing from @FlxGen is misleading.

Hey @Jan-NET I think you might be onto something here. Indeed, the server may choose when to use it himself. In this case, we also need to check "Content-Encoding" in response. I'll re-open this bug.

Hi @annakocheshkova,
thank you for your fast response.
I got the source code from Mobile Service Client up and running in my project and while debugging the situation is like this: In the HTTP-request is no „Accept-Encoding“ header. I don‘t know why!
In the HTTP-response is only the „Vary: Accept-Encoding“ header, not the „Content-Encoding“ header; response.Content.Headers.ContentLength is null so the raised MobileServiceInvalidOperationException is logical.
As far as I understand if the server responds with „Vary: Accept-Encoding“ the encoding varies indirectly by the value in „Accept-Encoding“ from the request. Probably means if the request accepts gzip and the server responds „Vary: Accept-Encoding“ you can assume that the content is encoded with gzip.
The following code would work if it’s for sure the any encoding is accepted by the client. But I don’t like code that assume somewhat is for sure. Actually, the request must also be taken into account (like in the current version of IsDecompressionUsed), but without a header...
 private static bool IsDecompressionUsed(HttpResponseMessage response)
        {
            IEnumerable<string> EncodingList;
            response.Headers.TryGetValues("Content-Encoding", out EncodingList);
            if (EncodingList == null)
            {
                // check for Vary header
                IEnumerable<string> VaryList;
                response.Headers.TryGetValues("Vary", out VaryList);
                if (VaryList == null)
                {
                    return false;
                }
                else
                {
                    string allVaryValues = VaryList.Aggregate((allValues, next) => allValues = allValues + ";" + next);
                    return !string.IsNullOrEmpty(allVaryValues) && (allVaryValues.Contains("Accept-Encoding"));
                }
            }
            else
            {
                string allEncodingValues = EncodingList.Aggregate((allValues, next) => allValues = allValues + ";" + next);
                return !string.IsNullOrEmpty(allEncodingValues) &&
                     (allEncodingValues.Contains("gzip") ||
                     allEncodingValues.Contains("deflate") ||
                     allEncodingValues.Contains("br") ||
                     allEncodingValues.Contains("compress"));
            }
        }

@Jan-NET Does my original PR work? It didn't have the IsDecompressionUsed() check.
https://github.com/Azure/azure-mobile-apps-net-client/pull/515/files

@Jan-NET
Yes, my initial idea was to check both request and response for this value.
I've read several pages about this “Vary” keyword and basically it ensures that the requested resource would not be loaded from cache if the header value is different. So if a compressed resource is stored in cache and the request does not accept encoding, a new page will be returned. The most understandable explanation I found is here.
They also say that the “Content-Encoding” is not enough in this case, but yeah, worth checking anyway.
In any case, thanks for the snippet and the debugging! Will be very helpful.

Hi @jcbdev,
no, it doesn’t work!
response.Content.Headers.TryGetValues results in false because the header field Content-Length is not in the response. So the default value null for contentLength is passed to the null-check and the exception raises.
If you want to guard against the missing content-length header why then the check against null is still necessary?
If I use the mobile client in an UWP-App against the same backend it works fine. The Content-Length is in the response header and Accept-Encoding is in the request.
I'm afraid we're playing in the wrong place. Which layer discards the header information in the android environment?

@annakocheshkova
As I wrote to @jcbdev the mobile client behavior between the several environments is not consistent.
Based on this it is questionable whether we can get a robust check.
Who knows the whole traffic pipeline?

@Jan-NET This is why I attempt read the content regardless of what the header says as a work around.  We are expecting content in these methods anyways so if the result of GetResponseContent() is null then I throw.
I agree there seems to be some inconsistency in the headers.  I wasn't able to figure out why but I think it's related to requests sent to the server and a new/updated server config or change to one or more classes in System.Net.Http.
What I found is that when the client creates requests after a fresh install, I get the proper response headers.  If I quit the app and try again, I don't.  There must be some mechanism that existed prior to whatever changed on the server side that causes this but the server no longer masks the bug.
I'll remove my work around and generate the request again so everyone can compare fresh install requests and after quitting the app.  Probably won't be until next week.

@FlxGen
According to my latest findings I agree with you that we can get rid of the header problems with the later response check in GetResponseContent().
May your appearances (fresh install, restart app) have to do with a cache on the server side or a proxy?
If I test/check my mobile service backend with Fiddler or Postman the responses shows a consistent picture. I trust the responses from the server, but not the processing in the client!
Unfortunately, I lack the knowledge of how Mono / .NET / Xamarin interact on an Android device and where to hook in for further debugging.

This is fixed in PR #554, which was just merged into master.  It will be released in the next couple of weeks as v4.2.0


Build faild on Windows server 2019

Output of the ue4-docker info command:
ue4-docker version:         0.0.27
Operating system:           Windows Server 2019 Datacenter Evaluation Version 1809 (OS Build 17763.379)
Docker daemon version:      18.09.5
NVIDIA Docker supported:    No
Maximum image size:         200GB
Total system memory:        15.95 GiB
Number of processors:       8 physical, 16 logical

Exec command:
ue4-docker build 4.21.1 --no-engine

Error detail:
ParallelExecutor.Execute:      Creating library C:\UnrealEngine\Engine\Plugins\Runtime\Analytics\AnalyticsMulticast\Intermediate\Build\Win64\UE4Editor\Development\AnalyticsMulticast\UE4Editor-AnalyticsMulticast.lib and object C:\UnrealEngine\Engine\Plugins\Runtime\Analyt
ics\AnalyticsMulticast\Intermediate\Build\Win64\UE4Editor\Development\AnalyticsMulticast\UE4Editor-AnalyticsMulticast.exp
ParallelExecutor.Execute:   UE4Editor-FileLogging.lib
ParallelExecutor.Execute:      Creating library C:\UnrealEngine\Engine\Plugins\Runtime\Analytics\FileLogging\Intermediate\Build\Win64\UE4Editor\Development\FileLogging\UE4Editor-FileLogging.lib and object C:\UnrealEngine\Engine\Plugins\Runtime\Analytics\FileLogging\Inter
mediate\Build\Win64\UE4Editor\Development\FileLogging\UE4Editor-FileLogging.exp
Log.WriteException: ==============================================================================
Log.WriteException: ERROR: BUILD FAILED:  failed, retries not enabled:
Log.WriteException:        while executing <Compile Target="UE4Editor" Configuration="DebugGame" Platform="Win64" Arguments="-precompile -allmodules" AllowXGE="True" AllowParallelExecutor="True" Tag="#UE4Editor Win64" />
Log.WriteException:        while executing <Compile Target="UE4Editor" Configuration="Development" Platform="Win64" Arguments="-precompile -allmodules" AllowXGE="True" AllowParallelExecutor="True" Tag="#UE4Editor Win64" />
Log.WriteException:        at Engine\Build\InstalledEngineBuild.xml(122)
Log.WriteException:        (see C:\UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
Log.WriteException:
Log.WriteException: AutomationException: BUILD FAILED:  failed, retries not enabled:
Log.WriteException:    at AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable`1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InUseParallelExecutor, Boolean InForceNonUnity, Boolean InForceUnity, Boolean InShowProgress, Nullabl
e`1 InChangelistNumberOverride, Dictionary`2 InTargetToManifest) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\UE4Build.cs:line 1266
Log.WriteException:    at AutomationTool.CompileTaskExecutor.Execute(JobContext Job, HashSet`1 BuildProducts, Dictionary`2 TagNameToFileSet) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildGraph\Tasks\CompileTask.cs:line 160
Log.WriteException:    at AutomationTool.Node.Build(JobContext Job, Dictionary`2 TagNameToFileSet) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildGraph\Node.cs:line 202
Log.WriteException:    at AutomationTool.BuildGraph.BuildNode(JobContext Job, Graph Graph, Node Node, TempStorage Storage, Boolean bWithBanner) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildGraph\BuildGraph.cs:line 700
Log.WriteException:    at AutomationTool.BuildGraph.BuildAllNodes(JobContext Job, Graph Graph, TempStorage Storage) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildGraph\BuildGraph.cs:line 629
Log.WriteException:    at AutomationTool.BuildGraph.Execute() in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\BuildGraph\BuildGraph.cs:line 435
Log.WriteException:    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 563
Log.WriteException:    at AutomationTool.Automation.Process(String[] Arguments, StartupTraceListener StartupListener) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 533
Log.WriteException:    at AutomationTool.Program.MainProc(String[] Arguments, StartupTraceListener StartupListener) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 173
Log.WriteException:    at AutomationTool.Program.<>c__DisplayClass1_0.<Main>b__2() in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 99
Log.WriteException:    at AutomationTool.InternalUtils.RunSingleInstance(Func`1 Main) in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 725
Log.WriteException:    at AutomationTool.Program.Main() in C:\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 99   data: EpicGames.Context = ("while executing <Compile Target="UE4Editor" Configuration="DebugGame" Platform="Win64" Arguments="-precompile
 -allmodules" AllowXGE="True" AllowParallelExecutor="True" Tag="#UE4Editor Win64" />", "while executing <Compile Target="UE4Editor" Configuration="Development" Platform="Win64" Arguments="-precompile -allmodules" AllowXGE="True" AllowParallelExecutor="True" Tag="#UE4Edit
or Win64" />", "at Engine\Build\InstalledEngineBuild.xml(122)")
Log.WriteException: ==============================================================================
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

I'm not seeing any actual error details there, which suggests that an error was reported earlier in the output during the compilation of a translation unit and the build subsequently failed on a link operation that attempted to consume the object file. The two most common errors that behave this way are fatal error LNK1318: Unexpected PDB error; OK (0) and fatal error C1060: the compiler is out of heap space. If you have the complete output log, could you please look further back to see if either of these errors was emitted?


⚠ Bofrost.es has degraded performance

In 73f1a97, Bofrost.es (https://www.bofrost.es) experienced degraded performance:

HTTP code: 200
Response time: 3843 ms

Resolved: Bofrost.es performance has improved in 6a267b9 after 23 minutes.


API improvements

A couple ideas to improve the API of the package:
RegisterCheck should accept a check and a config separately: RegisterCheck(check Check, cfg *Config) error
This would allow making the config optional (given the health checker accepts a default config applied to all checks). I realize this might not make sense in all cases, but it would give the user a cleaner API when they get to learn the package.
I could even imagine
RegisterCheck(check Check) error
RegisterCheckWithConfig(check Check, cfg Config) error

Or with functional options:
type CheckOption interface {
    applyCheck(check *check)
}

RegisterCheck(check Check, ...CheckOption) error

(Note: #25 implements functional options, this would work on top of that)

Consider dropping deregistration: is it really a useful feature? Making the health checker mutable this way is confusing and prone to error in my opinion. Obviously, if there is a legitimate use case it should stay.
As a consequence, I'd also add a Start (and Stop?) method to the health checker and make RegisterCheck return an error for a started health checker.
Alternatively, create a separate HealthBuilder that's mutable and build a HealthChecker with the builder that's immutable.

I realize these are huge changes, but in the long run these could improve the package API by making it more obvious and compact.

TBH, I don't remember why I added the deregister check API in the first place, but it could be useful for those who want a check that only runs once for example.
I agree the mutability is error prone, but I'm not sure about the usage patterns.
Re check + config on registration, I think this can be a good change. Shouldn't be too hard, though this is breaking.
Start/Stop: IDK... I think most or all use cases only require it to always run

TBH, I don't remember why I added the deregister check API in the first place, but it could be useful for those who want a check that only runs once for example.
I agree the mutability is error prone, but I'm not sure about the usage patterns.
Re check + config on registration, I think this can be a good change. Shouldn't be too hard, though this is breaking.
Start/Stop: IDK... I think most or all use cases only require it to always run

I've sent a PR with the suggested changes.

Done. See the above linked PR (and the PRs linked to that PR).


Android - Can't show notification when lock screen

As the title. i can't show notification when lock screen on android

cordova-plugin-fcm-with-dependecy-updated: 6.3.1
cordova-android: 8.1.0

Thanks.

There is a huge chance it might be related to the notification importance.
To test if this is the issue. I recommend that you create a high importance public channel, like bellow:
FCMPlugin.createNotificationChannelAndroid({
  id: "urgent_alert", // required
  name: "Urgent Alert", // required
  description: "Very urgent message alert",
  importance: "high", // https://developer.android.com/guide/topics/ui/notifiers/notifications#importance
  visibility: "public", // https://developer.android.com/training/notify-user/build-notification#lockscreenNotification
});

And when send to FCM through the API, add the android_channel_id attribute, like bellow:
{
  "notification":{
    "title":"Notification title",
    "body":"Notification body",
    "click_action":"FCM_PLUGIN_ACTIVITY",
  },
  "data":{
    "param1":"value1",
    "param2":"value2"
  },
  "to":"TOPIC OR DEVICE TOKEN",
  "priority":"high",
  "android_channel_id":"urgent_alert"
}

i tried above code.. but still can't show notification when locked screen. My device using is xiaomi, android 7.1.2.

You set visibility as "private". Would try to create a new channel setting as "public"?
Just as a test?
As channels created are immutable, you would have to uninstall and install again, or change here the id and name for something else and, in the push payload add the "android_channel_id" to the new one.

Yes.. just set "private" for test. I tried change the channel id.. my phone can recieve notification with sound.. but still can't show the message on lock screen .
I tried samsung phone can working... so I think this issue is private config of xiaomi phone.

A model-specific android version might take this importance as a suggestion and act differently.
As far as I know, there is official no way to force it.


Consider pywebview to deploy software on desktop

I have helped to develop an collaborative annotation system with Python, FastAPI and pywebview which probably be better than Electron.
I would definitely prefer Python over ECMAScript, albeit, pywebview does not require any HTML software, to be written in Python.
This is the list of software that powers Blasta https://blasta.woodpeckersnest.eu/help/about/software
Source: https://git.xmpp-it.net/sch/Blasta
pywebview: https://pywebview.flowrl.com/

I have added a clarification:
I would definitely prefer Python over ECMAScript, albeit, pywebview does not require any HTML software, to be written in Python.


Uncaught ReferenceError: moment is not defined

Hello,
I installed this modules but when I try to use it registering the angular modules, it gives me this runtime error.
Uncaught ReferenceError: moment is not defined
Any idea?

I'm also getting this error. Our build process doesn't use node so I copied the file from dist to where we keep our scripts and on build I see that in the terminal. It appears to be the moment provider, but I don't know enough about webpack to diagnose what should be done. I have Moment.js in the same folder so it should be available.

Just worked it out for us, it was a problem with our ASP bundling, you need to make sure it's in the same bundle (or a later bundle) with moment.js (it was in our angular bundle, which is why I wasn't getting an error for angular).

I've just figured out the problem. It was a webpack problem. I use a provider to include moment to webpack bundle and in my configuration moment was placed in window.moment in place of moment, and since this module search moment in a variable called moment he wasn't able to find it.


Fix NetCat UDP Source table in FlumeUserGuide.rst

Netcat UDP source's table in the user guide was broken, rendering failed with Malformed table. Text in column margin at line offset 7 error.

Trivial fix, looks good to me :+1:


scanner: Store file listings in a dedicated storage

We currently have the interface FileArchiverStorage with FileArchiverFileStorage and PostgresFileArchiverStorage as implementations. These can be re-used after generalizing them, e.g. rename as follows

FileArchiverStorage -> ProvenanceFileStorage
FileArchiverFileStorage -> FileProvenanceFileStorage
PostgresFileArchiverStorage -> PosgresProvenanceFileStorage

and then make the interface / implementation agnostic of any file extension and file name.

These can be re-used after generalizing them, e.g. rename as follows

But aren't your proposed names actually more specific than more generic? Because previously, e.g. FileArchiverFileStorage could store any file archives, even those not containing any provenance-related information.


Fix flow direction

Changed the sign of the qmodf flow between MF6 and MetaSWAP.
I implemented this incorrectly before, to account for errors that were apparently created by the diverging heads.
The head divergence issue is now fixed in the MetaSWAP.dll and it seems that multiplying qmodf with -1.0 created an erronous coupling and should therefore be reverted.

let's fix black and then merge...

Formatted with black and merged


Build (almost) the entire monorepo in Docker

Summary
This PR adds a Docker image with software installed to build most of the libraries. It also sets up a Travis build.
Details
The docker image is based on Alpine Linux. The base image is mhart/alpine-node rather than alpine because the latter only has a nodejs package version 6 (we need 7).
Some libraires are not built (or only partially built):

gherkin/c - compiled, but not tested - there is a failing test (bug)
gherkin/dotnet - there is no mono package for alpine yet
gherkin/go - there is no go package for alpine yet
gherkin/objective-c - there is no xcodebuild for Linux

There libraries are fully built in their subrepos' Travis builds, which do not run in Docker and therefore have more tooling available.
Motivation and Context
The main reason for this PR is to have CI builds for contributor PRs.
The other reason is to make it easier for contributors to run tests locally without having to install a lot of software (just Docker).
How Has This Been Tested?
Travis runs the build!
Checklist:

[x] I've added tests for my code.
[x] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.

I've opened a separate ticket about documenting this: #166


fix(typescript): fix CSSProperties type by adding borderRadius

What: Adding borderRadius to TS typing

Why: borderRadius is general CSS property

How: You know, just adding it.

Checklist:

[x] Documentation
[ ] Tests
[x] Ready to be merged
[x] Added myself to contributors table

Codecov Report

Merging #330 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #330   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files          10     10
  Lines         174    174
  Branches       48     48
=====================================
  Hits          174    174

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31b8bf2...0ebc299. Read the comment docs.

Thanks so much for your help! I've added you as a collaborator on the project. Please make sure that you review the CONTRIBUTING.md file (specifically the bit about the commit messages and the git hooks) and familiarize yourself with the code of conduct (we're using the contributor covenant). You might also want to watch the repo to be notified when someone files an issue/PR. Please continue to make PRs as you feel the need (you can make your branches directly on the repo rather than your fork if you want). Thanks! And welcome to the team :)

@kentcdodds Oh, It's kind of you to do so...


How to add a new dataset?

How to add a new dataset, is there a guide or I just add a pull request?

Hi! We added contribution guidelines to the docs.
In a nutshell, you just fork the repo, follow the instructions above and create a PR


Using AspNetCoreModuleV2 and hostingModel="InProcess" gives 200 OK, but no content in response

Hi!
Trying to run my self-contained web api with .NET Core 2.2 on IIS as InProcess. I doing a GET request to the server, I get an 200 OK, but with no content / payload. Only switching the hostingModel to "OutOfProcess", the web api starts returning content again.
I have done the following:

Added this in the project file:

<PropertyGroup>
  <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>

Installed .NET Core Runtime 2.2.0 on Windows Server 2008 R2

Changed web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\NAS.AppsProxy.Api.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Stage" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: BEB1A5AA-1DA2-4CBA-80DD-30EEEB3AD047-->

The runtimeIdentifier is set to win7-x64, the app pool has enable 32-bit set to false, and the .NET Core Runtime is x64 (but x86 is also installed on server).

Verified that the AspNetCoreModuleV2, %ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll is visible under Modules on IIS

Setting hostingModel="InProcess" to hostingModel="OutOfProcess" made things work.
The stdout does not log any errors, and this is the output enabling the enhanced diagnostic logs:
[aspnetcorev2_inprocess.dll] Initializing logs for 'C:\www\appsproxynetcore\aspnetcorev2_inprocess.dll'. Process Id: 4604.. File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98.
[aspnetcorev2_inprocess.dll] Waiting for initialization
[aspnetcorev2_inprocess.dll] Starting in-process worker thread
[aspnetcorev2_inprocess.dll] Resolving hostfxr parameters for application: '.\NAS.AppsProxy.Api.exe' arguments: '' path: 'C:\www\appsproxynetcore\'
[aspnetcorev2_inprocess.dll] Known dotnet.exe location: ''
[aspnetcorev2_inprocess.dll] Process path '.\NAS.AppsProxy.Api.exe' is not dotnet, treating application as standalone or portable with bootstrapper
[aspnetcorev2_inprocess.dll] Checking application.dll at 'C:\www\appsproxynetcore\.\NAS.AppsProxy.Api.dll'
[aspnetcorev2_inprocess.dll] Checking hostfxr.dll at 'C:\www\appsproxynetcore\.\hostfxr.dll'
[aspnetcorev2_inprocess.dll] hostfxr.dll found app local at 'C:\www\appsproxynetcore\.\hostfxr.dll', treating application as standalone
[aspnetcorev2_inprocess.dll] Parsed hostfxr options: dotnet location: '' hostfxr path: 'C:\www\appsproxynetcore\.\hostfxr.dll' arguments:
[aspnetcorev2_inprocess.dll] Argument[0] = 'C:\www\appsproxynetcore\.\NAS.AppsProxy.Api.exe'
[aspnetcorev2_inprocess.dll] In-process callbacks set
[aspnetcorev2_inprocess.dll] Event Log: 'Application 'C:\www\appsproxynetcore\' started the coreclr in-process successfully.'
End Event Log Message.

Does anyone else experience the same? I have tired to follow the https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-2.2, but I may have missed something?
Any help is much appreciated.
Thanks in advance!

Can you please share the list of headers (from chrome networking tab) that is returned in InProcess and OutOfProcess modes.
Does WebAPI call in question do anything special?

Thanks for your quick reply!
OutOfProcess, response headers:
HTTP/1.1 200 OK
Date: Thu, 13 Dec 2018 20:24:47 GMT
Server: Kestrel
Content-Type: application/json; charset=utf-8
X-Powered-By: ASP.NET
ServedBy: SERVER01
Via: 1.1 www.testdomain.com
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Length: 21158

InProcess response headers:
HTTP/1.1 200 OK
Date: Thu, 13 Dec 2018 20:19:20 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
ServedBy: SERVER01
Via: 1.1 www.testdomain.com
Keep-Alive: timeout=10, max=99
Connection: Keep-Alive
Content-Length: 0

No, the WebAPI just serve some configuration data as json, nothing special.

Can you show the code for the MVC controller that is returning the JSON result?

Hi @jkotas!
Thanks for helping me out.
This is the code for the MVC/WebApi Controller returning the JSON result.
using System;
using System.Threading.Tasks;
using AutoMapper;
using HealthCheck;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using NAS.AppsProxy.BusinessEntities.Config;
using NAS.AppsProxy.BusinessLogic;
using NAS.AppsProxy.BusinessLogic.Config;
using NAS.AppsProxy.BusinessLogic.Options;
using GetCountryDataResponse = NAS.AppsProxy.Api.Protocol.Config.GetCountryDataResponse;
using Result = NAS.AppsProxy.Api.Protocol.BaseProtocol.Result;

namespace NAS.AppsProxy.Api.Controllers
{
    [Route("V1/[controller]")]
    public class ConfigController : Controller
    {
        private readonly IClient<ClientOptions> _client;
        private readonly ILogger<ConfigController> _logger;
        private readonly IMapper _mapper;
        private readonly IHealthChecker _healthChecker;
        private readonly ICachedCountryDataService<CachedCountryDataServiceOptions> _countryService;

        public ConfigController(IClient<ClientOptions> client,
            ICachedCountryDataService<CachedCountryDataServiceOptions> countryService,
             ILogger<ConfigController> logger,
            IMapper mapper,
            IHealthChecker healthChecker)
        {
            _client = client;
            _countryService = countryService;
            _logger = logger;
            _mapper = mapper;
            _healthChecker = healthChecker;
        }

        [HttpGet]
        [Route("GetCountries/{*catchall}")]
        public async Task<GetCountryDataResponse> GetCountries()
        {
            _logger.LogDebug("GetCountries...");
            var response = new GetCountryDataResponse();
            var dateStart = DateTime.Now;
            try
            {
                CountryDataCacheItem countryCacheItem = await _countryService.GetCountryData(_client.GetCurrentLanguageCountryCode());
                _mapper.Map(countryCacheItem.CountryList, response.CountryDataList);
                response.Hash = countryCacheItem.Hash;
                _healthChecker.AddTimeValue("GetCountries", dateStart, DateTime.Now, false);
                _logger.LogDebug("GetCountries OK");
                response.Result = Result.Ok;
            }
            catch (Exception e)
            {
                _logger.LogError(e, "GetCountries");
                _healthChecker.AddTimeValue("GetCountries", dateStart, DateTime.Now, true);
                string desc = "GetCountries failed";
                _healthChecker.AddMessage("GetCountries", AppUniqueCodes.GET_COUNTRIES_FAILED.ToString(), DateTime.Now, desc);
                response = new GetCountryDataResponse { Result = new Result { UniqueCode = AppUniqueCodes.GET_COUNTRIES_FAILED, Description = desc } };
            }

            return response;
        }
    }
}

Unable to reproduce the error running locally on Windows 10, and in on our dev server running Windows Server 2012 R2. But in our stage environment running Windows Server 2008 R2 I have issues. But I do not know if it has anything to do with windows version...

It could be due to the Windows version you are using, however we run tests on Windows Server 2008 R2 and are seeing them pass. Are you able to debug on your staging environment? You can also enable IIS features like FREB: https://docs.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis to see what is being written to the response.
I would also check if this applies to any response (ex: do a simple context.Response.WriteAsync("test");  and see if that works.

Sadly our stage environment is in "Christmas freeze", so I'm not allowed to touch anything. I'll try to get hold of another Windows Server 2008 and try to reproduce the issue.


banzai 0.6.10 with istio 1.6.8 - operator reconcile fails

Describe the bug
{"level":"error","ts":1598294823.9229474,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"istio-controller","request":"istio-system/istio-carnet","error":"could notreconcile istio: failed to reconcile dynamic resource: creating resource failed: Internal error occurred: failed calling webhook "validation.istio.io": Post https://istiod.istio-system.svc:443/validate?timeout=30s: no endpoints available for service "istiod"","errorVerbose":"Internal error occurred: failed calling webhook "validation.istio.io": Post https://istiod.istio-system.svc:443/validate?timeout=30s: no endpoints available for service "istiod"\ncreating resource failed\ngithub.com/banzaicloud/istio-operator/pkg/k8sutil.(*DynamicObject).Reconcile\n\t/go/src/github.com/banzaicloud/istio-operator/pkg/k8sutil/unstructured.go:62\ngithub.com/banzaicloud/istio-operator/pkg/resources/citadel.(*Reconciler).Reconcile\n\t/go/src/github.com/banzaicloud/istio-operator/pkg/resources/citadel/citadel.go:139\ngithub.com/banzaicloud/istio-operator/pkg/controller/istio.(*ReconcileIstio).reconcile\n\t/go/src/github.com/banzaicloud/istio-operator/pkg/controller/istio/istio_controller.go:353\ngithub.com/banzaicloud/istio-operator/pkg/controller/istio.(*ReconcileIstio).Reconcile\n\t/go/src/github.com/banzaicloud/istio-operator/pkg/controller/istio/istio_controller.go:237\nsigs.k8s.io/controller-runtime/pkg/internal/controller.
Steps to reproduce the issue:
Deployed 0.6.10 with istio 1.6.8 version
Expected behavior
Istio 1.6.8 using banzai istio 0.6.10

@satishmane,
was it a temporary error or are you getting it constantly?

Seems to be only a temporary issue, please reopen if you experience this constantly or it causes any issues!


Add vf check for italic bug in Safari

Observed behaviour
https://matthewstrom.com/writing/variable-fonts describes a safari bug where ital and slnt axes must be set correctly, or the font always renders italic.
Expected behaviour
We check these values are correct

We now have axis registry expectations for slant and italic, and we check our fonts against the values specified for them. If there's still an issue here, move it to axisregistry. :-)


True 16 bit transfer, and new loop friendly 16 bit transfer

This replaces the transfer16() with a true 16 bit transfer, adds a new loop friendly 16 bit transfer, and rename the old transfer16() as two bytes to transfer16_asbytes()

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

In fact I did sign the CLA,  I filled in the form, ticked the box and clicked the button.
Your software after that asked for access to my private data.   When a bot asks for access to private data, that is where I draw the line, as any normal person should.
I plan to keep the fork up, or at least the patched SPI support with the functioning and improved 16 bit transfers.     It seems there are people who want it.
Or, you could incorporate into the main tree yourself, you certainly have my permission to do that.  Just let me know if you do.

By the way "invalid" is insulting.   The problem as described above, is in CLA assistant.   And if you check around you will see complaints about this are common.


Update 2023-05-01-preview version with changes from 2023-04-01 version.

ARM API Information (Control Plane)
Swagger PR for new api verison 2023-04-01 was merged together with 2023-05-01-preview version.
Hence, this PR is to update 2023-05-01-preview version with property introduced in v2023-04-01.
MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Azure 1st Party Service can try out the Shift Left experience to initiate API design review from ADO code repo.  If you are interested, may request engineering support by filling in with the form https://aka.ms/ShiftLeftSupportForm.
Changelog
Add a changelog entry for this PR by answering the following questions:

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[x] update existing version to fix swagger quality issue in s360
[ ] Other, please clarify

When are you targeting to deploy the new service/feature to public regions? Please provide the date or, if the date is not yet available, the month.
This new api version is deployed to all regions.
When do you expect to publish the swagger? Please provide date or, the the date is not yet available, the month.
As soon as the new api version is updated in swagger.
By default, Azure SDKs of all languages (.NET/Python/Java/JavaScript for both management-plane SDK and data-plane SDK, Go for management-plane SDK only ) MUST be refreshed with/after swagger of new version is published. If you prefer NOT to refresh any specific SDK language upon swagger updates in the current PR, please leave details with justification here.

Contribution checklist (MS Employees Only):

[x] I commit to follow the Breaking Change Policy of "no breaking changes"
[x] I have reviewed the documentation for the workflow.
[x] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

Applicability: :warning:
If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

Change to data plane APIs
Adding new properties
All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

[ ] Check this box if any of the following apply to the PR so that the label "ARMReview" and "WaitForARMFeedback" will be added by bot to kick off ARM API Review.  Missing to check this box in the following scenario may result in delays to the ARM manifest review and deployment.

Adding a new service
Adding new API(s)
Adding a new API version
-[ ] To review changes efficiently, ensure you copy the existing version into the new directory structure for first commit and then push new changes, including version updates, in separate commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki.

[x] Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If you have any breaking changes as defined in the Breaking Change Policy, request approval from the Breaking Change Review Board.
Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Additional details on the process and office hours are on the Breaking Change Wiki.
NOTE: To update API(s) in public preview for over 1 year (refer to Retirement of Previews)
Please follow the link to find more details on PR review process.

my team have two API versions v2023-04-01 and v2023-05-01-preview that unfortunately got merged together. So I have created a separate PR to update 2023-05-01-preview version with a property introduced in v2023-04-01.

Above is the comment @ajtiwari07 left in Teams chat, the user would like to update the existing preview version instead of new version.


Using filename-parameter in save-Method does not work in Safari

jspdf: Cutomizing the name for saving file not working on Safari but works well for IE, Chrome and FF. pdf.save("Name"); not working for Safari, instead, it opens a new window with url "data:application/pdf;base64,JVBER...." and displays the pdf and for saving gives an option to save the file with a random default string(which I think is a part of base64 string for that file) instead of the name specified in pdf.save("NAME")

please do not use the title for the description of your issue. A title should be short.

same condition in my case also..how to solve this?

Duplicate of #697


Add configuration to automatically freeze funds for Validators

Faucet will now keep track of frozen funds of Validators, and create
one if they dont have any.
this will help us scale number of validators in our test network without
manually changing the genesis.

What will trigger these validators to enroll?

What will trigger these validators to enroll?

recurring_enrollment config

Merge and deploy at will


suppress sphinx-gallery thumbnail comments in output

This enables a recent sphinx-gallery feature that suppresses the sphinx_gallery_thumbnail_number comments in the rendered tutorials.

Thanks @drammock


24G torch.cuda.OutOfMemoryError: CUDA out of memory

24G玩不了

Yes, if you want to fine-tune the 7b model with full parameters, a 24G GPU memory is indeed somewhat limited. However, the core of BPO lies in the prompt optimization pairs which could reflect human preferred features. Regarding the training method, you can completely adopt techniques like lora, etc.


fix: Fatal Exception: java.lang.NullPointerException

This solution is a workaround suggested in #105965 till Google maps is fixed


Resteasy 1463 bld test failures build43

I've cherry-picked b223008 commit only. So this can be closed, thanks.


deployApps.sh fails with python specific error

I'm trying to deploy using deployApps.sh but I get a strange Python specific error, log is appended below. using python3
error log
####<Feb 25, 2020 11:45:49 AM> <INFO> <deploy> <__deploy_online> <WLSDPLY-09007> <Connected to domain at t3://....:7001>
Problem invoking WLST - Traceback (innermost last):
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/deploy.py", line 441, in ?
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/deploy.py", line 426, in main
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/deploy.py", line 195, in __deploy
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/deploy.py", line 258, in __deploy_online
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/wlsdeploy/tool/deploy/model_deployer.py", line 51, in deploy_applications
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/wlsdeploy/tool/deploy/applications_deployer.py", line 70, in deploy
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/wlsdeploy/tool/deploy/applications_deployer.py", line 216, in _ApplicationsDeployer__online_deploy_apps_and_libs
  File "/u01/elhwls/deployables/weblogic-deploy/lib/python/wlsdeploy/tool/deploy/applications_deployer.py", line 380, in _ApplicationsDeployer__get_existing_apps
TypeError: get_existing_object_list() takes at least 2 arguments (1 given)

and here is how I run it
# this is where I copied WAR files and weblogic-deploy
cd /u01/the_user/deployables

export ORACLE_HOME=/u01/binaries/the_user/fmw/<IP_ADDRESS>.0
export WL_HOME=$ORACLE_HOME/wlserver
export WEBLOGIC_DEPLOY=/u01/the_user/deployables/weblogic-deploy

$WEBLOGIC_DEPLOY/bin/deployApps.sh \
	-oracle_home $ORACLE_HOME \
	-domain_home /u01/the_user/domain/elhwls_domain \
	-archive_file appserver-portal.war \
	-model_file appserver-portal.yaml \
	-admin_url t3://ADMIN_URL:6010 -admin_user ADMIN_USER


Update readme for PypPi

Coverage remained the same at 90.909% when pulling 0e107b43956415473f3b99a7ffe9f4b759b8a9d8 on develop into c16e682b8adff9452ffa565a0789e8850982099a on master.