Merge pull request #858 from wabbajack-tools/manual-download-regression-fix

Manual download regression fix
This commit is contained in:
Timothy Baldridge 2020-05-22 15:54:42 -07:00 committed by GitHub
commit 803452c13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 33 deletions

View File

@ -1,5 +1,8 @@
### Changelog
#### Version - 2.0.6.1 - 5/22/2020
* Fix regression with manual archive downloading
#### Version - 2.0.6.0 - 5/21/2020
* Add auto-healing features back into the client/server code
* Put in the code about "Hashing Archives" that somehow missed the last release

View File

@ -6,8 +6,8 @@
<AssemblyName>wabbajack-cli</AssemblyName>
<Company>Wabbajack</Company>
<Platforms>x64</Platforms>
<AssemblyVersion>2.0.6.0</AssemblyVersion>
<FileVersion>2.0.6.0</FileVersion>
<AssemblyVersion>2.0.6.1</AssemblyVersion>
<FileVersion>2.0.6.1</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>An automated ModList installer</Description>
<PublishReadyToRun>true</PublishReadyToRun>

View File

@ -1,17 +0,0 @@
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
namespace Wabbajack.Common.Test
{
public class HttpClientTests
{
[Fact]
public async Task DoesntReuseHttpMessages()
{
var client = new Common.Http.Client();
// If we reuse the HTTP message this will throw a invalid operation exception
await Assert.ThrowsAsync<HttpRequestException>(async () => await client.GetAsync("http://blerg.blaz.bloz.buz"));
}
}
}

View File

@ -4,8 +4,8 @@
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyVersion>2.0.6.0</AssemblyVersion>
<FileVersion>2.0.6.0</FileVersion>
<AssemblyVersion>2.0.6.1</AssemblyVersion>
<FileVersion>2.0.6.1</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>Wabbajack Application Launcher</Description>
<PublishReadyToRun>true</PublishReadyToRun>

View File

@ -56,7 +56,7 @@ namespace Wabbajack.Lib.FileUploader
public static async Task<bool> UploadPackagedInis(IEnumerable<Archive> archives)
{
archives = archives.ToArray(); // defensive copy
Utils.Log($"Packaging {archives.Count()} inis");
Utils.Log($"Packaging {archives.Count()} archive states");
try
{
await using var ms = new MemoryStream();
@ -67,7 +67,7 @@ namespace Wabbajack.Lib.FileUploader
if (e.State == null) continue;
var entry = z.CreateEntry(Path.GetFileName(e.Name));
await using var os = entry.Open();
await os.WriteAsync(Encoding.UTF8.GetBytes(string.Join("\n", e.State.GetMetaIni())));
e.ToJson(os);
}
}

View File

@ -10,6 +10,7 @@ using System.Threading.Tasks;
using Wabbajack.Common;
using Wabbajack.Lib.Downloaders;
using System.Threading;
using Wabbajack.Common.Exceptions;
using Wabbajack.Lib.WebAutomation;
namespace Wabbajack.Lib.NexusApi
@ -267,7 +268,7 @@ namespace Wabbajack.Lib.NexusApi
if (!response.IsSuccessStatusCode)
{
Utils.Log($"Nexus call failed: {response.RequestMessage.RequestUri}");
throw new HttpRequestException($"{response.StatusCode} - {response.ReasonPhrase}");
throw new HttpException(response);
}
@ -317,9 +318,9 @@ namespace Wabbajack.Lib.NexusApi
{
return (await Get<List<DownloadLink>>(url)).First().URI;
}
catch (HttpRequestException)
catch (HttpException ex)
{
if (await IsPremium())
if (ex.Code != 403 || await IsPremium())
{
throw;
}

View File

@ -109,7 +109,7 @@ namespace Wabbajack.Server.Services
});
}
if (!summary.HasFailures)
if (!summary.HasFailures && oldSummary.Summary.HasFailures)
{
await _discord.Send(Channel.Ham,
new DiscordMessage
@ -146,7 +146,7 @@ namespace Wabbajack.Server.Services
var srcDownload = await _sql.GetArchiveDownload(archive.State.PrimaryKeyString, archive.Hash, archive.Size);
if (srcDownload == null || srcDownload.IsFailed == true)
{
_logger.Log(LogLevel.Information, $"Cannot heal {archive.State.PrimaryKeyString} because it hasn't been previously successfully downloaded");
_logger.Log(LogLevel.Information, $"Cannot heal {archive.State.PrimaryKeyString} Size: {archive.Size} Hash: {(long)archive.Hash} because it hasn't been previously successfully downloaded");
return (archive, ArchiveStatus.InValid);
}

View File

@ -67,7 +67,7 @@ namespace Wabbajack.Server.Services
await patch.Finish(_sql, size);
await _discordWebHook.Send(Channel.Ham,
await _discordWebHook.Send(Channel.Spam,
new DiscordMessage
{
Content =

View File

@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>2.0.6.0</AssemblyVersion>
<FileVersion>2.0.6.0</FileVersion>
<AssemblyVersion>2.0.6.1</AssemblyVersion>
<FileVersion>2.0.6.1</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>Wabbajack Server</Description>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>

View File

@ -6,8 +6,8 @@
<UseWPF>true</UseWPF>
<Platforms>x64</Platforms>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<AssemblyVersion>2.0.6.0</AssemblyVersion>
<FileVersion>2.0.6.0</FileVersion>
<AssemblyVersion>2.0.6.1</AssemblyVersion>
<FileVersion>2.0.6.1</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>An automated ModList installer</Description>
<PublishReadyToRun>true</PublishReadyToRun>