@@ -30,40 +30,9 @@ public IFileDownloader CreateClient(string hostId, string serverPath, int pollin
3030 private FileDownloader ( RemoteControlClient client )
3131 => _client = client ;
3232
33- #if NET
34-
35- /// <summary>
36- /// The netcore version of <see cref="RemoteControlClient"/> doesn't support ReturnStale. It will download the file
37- /// (on a separate thread), but then not cache it because it doesn't have access to the normal IE component that
38- /// does proper header reading/caching. Then, when we call in to read the file, we get nothing back, since nothing
39- /// was cached.
40- /// <para/> The temporary solution to this is to force the download to happen. This is not ideal as we will no
41- /// longer be respecting the server "Cache-Control:Max-Age" header. Which means we'll continually download the
42- /// files, even if not needed (since the server says to use the local value). This is not great, but is not
43- /// terrible either. First, we will only download the full DB file <em>once</em>, when it is actually missing on
44- /// the user's machine. From that point on, we'll only be querying the server for the delta-patch file for the DB
45- /// version we have locally. The vast majority of the time that is a tiny document of the form <c><![CDATA[<Patch
46- /// upToDate="true" FileVersion="105" ChangesetId="1CBE1453" />]]></c> (around 70 bytes) which simply tells the user
47- /// they are up to date. Only about once every three months will they actually download a large patch file. Also,
48- /// this patch download will only happen once a day tops (as that is our cadence for checking if there are new index
49- /// versions out).
50- /// <para/> https://github.com/dotnet/roslyn/issues/71014 tracks this issue. Once RemoteControlClient is updated to
51- /// support this again, we can remove this specialized code for netcore.
52- /// </summary>
53- public async Task < Stream ? > ReadFileAsync ( )
54- // Note: we try .ReturnStale first so this will automatically light up once they fix their issue, without
55- // us having to do anything on our end. Once we do get around to making a change, we'll remove the
56- // .ForceDownload part entirely.
57- => await _client . ReadFileAsync ( BehaviorOnStale . ReturnStale ) . ConfigureAwait ( false ) ??
58- await _client . ReadFileAsync ( BehaviorOnStale . ForceDownload ) . ConfigureAwait ( false ) ;
59-
60- #else
61-
6233 public Task < Stream ? > ReadFileAsync ( )
6334 => _client . ReadFileAsync ( BehaviorOnStale . ReturnStale ) ;
6435
65- #endif
66-
6736 public void Dispose ( )
6837 => _client . Dispose ( ) ;
6938}
0 commit comments