Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.17.2 - Update to .NET 8 + Various bugfixes #154

Merged
merged 20 commits into from
Jan 25, 2024
Merged

0.17.2 - Update to .NET 8 + Various bugfixes #154

merged 20 commits into from
Jan 25, 2024

Conversation

SakuraIsayeki
Copy link
Owner

Closes #111

- Updated the "maximumWarning" value from "500kb" to "1mb"
- Updated the "maximumError" value from "1mb" to "4mb"

fix(ng-bootstrap): Import NgbTooltipModule instead of NgbTooltip

- Replaced the import statement for `NgbTooltip` with `NgbTooltipModule` in app.module.ts
- Added a CSS class to the <h1> element for styling purposes
- Adjusted spacing and alignment of elements within the <h1> element
- Updated the positioning and styling of the total karma display

These changes improve the visual presentation of the player profile in the application.
- Updated the version of Nodsoft.WowsReplaysUnpack.ExtendedData package from 1.1.17-gfc59a0dbe8 to 1.1.21-g89971f3a87 in WowsKarma.Api.csproj file.
- Updated the target framework from net7.0 to net8.0.
- Updated package versions for Azure.Storage.Blobs, DSharpPlus, FlexLabs.EntityFrameworkCore.Upsert, Hangfire.AspNetCore, Hangfire.PostgreSql, Hangfire.Tags.PostgreSql, JetBrains.Annotations, Mapster, Mapster.DependencyInjection, Mapster.EFCore, Microsoft.ApplicationInsights.AspNetCore, Microsoft.AspNetCore.Authentication.JwtBearer, Microsoft.AspNetCore.SignalR.Protocols.MessagePack, Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson, Microsoft.CodeAnalysis.NetAnalyzers,
Microsoft.EntityFrameworkCore.Design,
Microsoft.Extensions.Configuration.CommandLine,
Npgsql.EntityFrameworkCore.PostgreSQL,
Serilog.AspNetCore,
Serilog.Extensions.Logging.
- Removed the package reference for System.IdentityModel.Tokens.Jwt.
- Change ApiDbContext class to be sealed
- Remove static constructor in ApiDbContext class
- Move DataTypeMapper configuration to a new extension method ConfigureApiDbDataSourceBuilder in ApiDbContextExtensions class
- Update Startup.cs to use the new ConfigureApiDbDataSourceBuilder extension method for configuring NpgsqlDataSource
- Updated the version of Nodsoft.WowsReplaysUnpack.ExtendedData package from 1.1.21-g89971f3a87 to 1.1.24-g30ae630d7d in WowsKarma.Api.csproj file.
- Updated the Hangfire configuration in the Startup class to use NpgsqlConnection instead of a connection string.
- Commented out the previous method of configuring Hangfire using a connection string and options object.
- Changed the AddPaginationHeaders method in HttpExtensions class to use the Append method instead of Add method when adding pagination headers to the HttpResponse object.
- Updated the database context to use `DateTimeOffset` instead of `DateTime` for timestamp properties in entities implementing the `ITimestamped` interface.
- Modified the `User`, `Clan`, `PlatformBan`, `Player`, and `Post` models to use `DateTimeOffset` for timestamp properties.
- Adjusted the code in various places to handle the changes in timestamp types correctly.
- In NotificationBase.cs, fixed the initialization of EmittedAt property to use DateTimeOffset.UtcNow instead of DateTime.UtcNow.
- In PostModAction.cs, removed redundant empty lines.
- In ReplayChatMessageDTO.cs, marked PlayerId, Username, MessageGroup, and MessageContent properties as nullable to disable API validation.
- In ReplayDTO.cs, initialized DownloadUri with an empty string and Players and ChatMessages properties with empty arrays.
This commit fixes a null reference exception that occurs when the chat messages list is empty. The code now checks if the chat messages list is null before adapting it to an IEnumerable of ReplayChatMessageDTO objects. If the list is null, an empty array is assigned instead. This prevents the null reference exception from occurring.

No other significant changes were made in this commit.
- Updated JetBrains.Annotations to version [2023.3,)
- Updated Microsoft.Extensions.Http to version [8.0.0,)
- Updated Microsoft.Extensions.Options.ConfigurationExtensions to version [8.0.0,)
- Updated Microsoft.IdentityModel.JsonWebTokens to version [7.2.0,)
- Updated System.Net.Http.Json to version [8.0.0,)

This commit updates the package references in the WowsKarma.Api.Minimap.Client project file, bumping up the versions of several dependencies for compatibility and potential bug fixes or enhancements.
- Updated Azure.Storage.Blobs package version to 12.20.0-beta.1
- Updated DSharpPlus package version to 4.4.6
- Added ExpressionDebugger package with version 2.2.1
- Updated Microsoft.AspNetCore.Authentication.JwtBearer package version to 8.0.1
- Adapted the code to nullable context
- Sealed all remaining classes
- Refactored various parts of the code to match new NET 8.0 standards
This commit adds nullable context migrations to the codebase. The `UpdateNullableContext` migration updates several columns in different tables to be non-nullable. Specifically, it modifies the `Players`, `ChatMessages`, and `BlobName` columns in the `Replays` table, the `Reason` column in the `PostModActions` table, and the `Username`, `OptOutChanged`, `Tag`, `Name`, and `Description` columns in the `Clans` table. These changes ensure that these columns cannot have null values.
The `Role` model's `Users` property has been updated to use a `List<User>` instead of an `IEnumerable<User>`.
- Simplified the implementation of the SearchAccount method in PlayerController.
- Replaced conditional statement with a ternary operator for better readability.
- Added 'await' keyword to the GetUserAsync method in UserService to ensure asynchronous execution.
- Simplified the implementation of the ListPlayersAsync method in PlayerService.
- Replaced conditional statement with a ternary operator for better readability.
- Updated return type to AccountListingDTO[] instead of IEnumerable<AccountListingDTO>.
This commit updates the `PostService` class in the `Posts` service to use UTC time instead of local time when refreshing the `UpdatedAt` property. This change ensures consistency across different time zones and avoids potential issues with daylight saving time changes.
- Updated Nodsoft.WowsReplaysUnpack.ExtendedData to version 2.0.1
- Updated Serilog.AspNetCore to version 8.0.1
The code changes in this commit fix a bug related to property validation on profile updates. Specifically, the `ProfileRoles` property was not being properly validated and could result in unexpected behavior. This issue has been resolved by updating the code in the `ProfileController.cs` and `PlayerService.cs` files.

In `ProfileController.cs`, the code has been modified to correctly handle the case where the user's roles are null or empty. Previously, it would return an empty enumerable instead of an empty array.

In `PlayerService.cs`, some unnecessary using statements have been removed, which improves code cleanliness and organization.

Additionally, in the `UserProfileFlagsDTO.cs` file, the default value for the `ProfileRoles` property has been set to an empty array to ensure consistency and avoid potential issues with null values.
@SakuraIsayeki SakuraIsayeki self-assigned this Jan 25, 2024
The code changes in this commit update the .NET version used in the build workflow from 7.0.x to 8.0.x.
@SakuraIsayeki SakuraIsayeki merged commit ed8873d into main Jan 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to submit a Mod Edit on post pages
1 participant