Code Monkey home page Code Monkey logo

wows-karma's Introduction

logo

WOWS Karma

The Persistent and Comprehensive Karma system for World of Warships.
(wows-karma.com)

WOWS Karma is a reputation system for Wargaming's hit game World of Warships.

Based on player-driven content, WOWS Karma allows players to send Posts to rate their interactions with other Players. These, in turn, fuel the platform that provides metrics to further evaluate, with precision, a player's Karma.

Furthermore, we believe in full transparency. All our platform metrics emanate from visible and public posts. This, coupled with the fact that anonymity is not a possibility, makes this platform traceable, thereby making it a more stable and precise Karma system than provided in-game.

Karma can go Negative here.

Allowing the Karma to go negative gives us extended metrics that can help distinguish the more troublesome elements of the community.

This is in clear contrast to the in-game Karma, which has a minimum cap flatting out at 0. Protecting a more volatile metric provides no distinction for real problems, which is possible on our platform.

Support for Replays

With recently added Replay analysis, we are providing a source of truth to every post.
As all posts are made public, any user can evaluate a player's claim, by reviewing the post's attached replay.

WoWs Monitor support

Our platform is used extensively by the popular statistics tool named WoWs Monitor.
This allows a prime readout of our metrics exactly where you need it: in battle.

Our metrics are read out in real-time by the WoWs Monitor and merged with in-game metrics. Interacting with a player can be hazardous, may it be with words, or with guns. You are able to second-opinion a player's standing using our metrics, in battle.

Furthermore, WOWS Karma's integration in the WoWs Monitor allows you to link directly to players, to streamline your interactions with the platform. Clicking on a player on the Monitor will open up his profile on WOWS Karma. Easy as that!


(WIP)

wows-karma's People

Contributors

calebabg avatar cyber-85381 avatar sakuraisayeki avatar spencernaugler7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wows-karma's Issues

Error when accessing some player's page

This error occurred when accessing the wows karma page from the wows-monitor program provided links for some players. The first log is for my account and the next one is just a random opponent who did poorly in the game. I thought it was the "_" in both of our names but some other players with the same "_" have a perfectly working page. I will leave the rest to you guys.

https://na.wows-karma.com/player/1049454182,Player_1159465670/

API Request: https://api.na.wows-karma.com:80/api/player/1049454182

WowsKarma.Web.Infrastructure.Exceptions.ApiErrorResponseException: System.Text.Json.JsonException: The JSON value could not be converted to System.Int64. Path: $.clanview.wows_ladder.members_count | LineNumber: 0 | BytePositionInLine: 502.
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan`1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase)
   at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonConverter converter, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
   at System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsyncCore[T](HttpContent content, Encoding sourceEncoding, JsonSerializerOptions options, CancellationToken cancellationToken)
   at Nodsoft.Wargaming.Api.Client.Clients.Wows.WowsClansApiClient.FetchClanViewAsync(UInt32 clanId, CancellationToken ct)
   at WowsKarma.Api.Services.ClanService.UpdateClanInfoAsync(ApiDbContext context, UInt32 clanId, Clan clan, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\ClanService.cs:line 84
   at WowsKarma.Api.Services.PlayerService.UpdatePlayerClanStatusAsync(Player player, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\PlayerService.cs:line 174
   at WowsKarma.Api.Services.PlayerService.GetPlayerAsync(UInt32 accountId, Boolean includeRelated, Boolean includeClanInfo, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\PlayerService.cs:line 96
   at WowsKarma.Api.Controllers.PlayerController.GetAccount(UInt32 id, Boolean includeClanInfo) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Controllers\PlayerController.cs:line 59
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WowsKarma.Api.Middlewares.RequestLoggingMiddleware.Invoke(HttpContext context) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Middlewares\RequestLoggingMiddleware.cs:line 49
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

https://na.wows-karma.com/player/1026846969,Slimy_Muppet/

API Request: https://api.na.wows-karma.com:80/api/player/1026846969

WowsKarma.Web.Infrastructure.Exceptions.ApiErrorResponseException: System.Text.Json.JsonException: The JSON value could not be converted to System.Int64. Path: $.clanview.wows_ladder.members_count | LineNumber: 0 | BytePositionInLine: 803.
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan`1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase)
   at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonConverter converter, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
   at System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsyncCore[T](HttpContent content, Encoding sourceEncoding, JsonSerializerOptions options, CancellationToken cancellationToken)
   at Nodsoft.Wargaming.Api.Client.Clients.Wows.WowsClansApiClient.FetchClanViewAsync(UInt32 clanId, CancellationToken ct)
   at WowsKarma.Api.Services.ClanService.UpdateClanInfoAsync(ApiDbContext context, UInt32 clanId, Clan clan, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\ClanService.cs:line 84
   at WowsKarma.Api.Services.PlayerService.UpdatePlayerClanStatusAsync(Player player, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\PlayerService.cs:line 174
   at WowsKarma.Api.Services.PlayerService.GetPlayerAsync(UInt32 accountId, Boolean includeRelated, Boolean includeClanInfo, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\PlayerService.cs:line 96
   at WowsKarma.Api.Controllers.PlayerController.GetAccount(UInt32 id, Boolean includeClanInfo) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Controllers\PlayerController.cs:line 59
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WowsKarma.Api.Middlewares.RequestLoggingMiddleware.Invoke(HttpContext context) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Middlewares\RequestLoggingMiddleware.cs:line 49
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Unable to submit a Mod Edit on post pages

Some post pages are missing player names in the chat logs, resulting in 400 error when trying to submit a mod edit

MacOS Opera GX browser

Request body:

{
	"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
	"title": "One or more validation errors occurred.",
	"status": 400,
	"traceId": "00-cba87e9e5cbb5f826123d0094a450482-77ddb2b797188cc2-00",
	"errors": {
		"UpdatedPost.Replay.ChatMessages[0].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[1].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[2].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[3].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[4].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[5].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[6].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[7].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[8].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[9].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[10].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[11].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[12].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[13].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[14].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[15].Username": [
			"The Username field is required."
		],
		"UpdatedPost.Replay.ChatMessages[16].Username": [
			"The Username field is required."
		]
	}
}

Qualty of life improvement for WOWS Karma moderators

An inefficient present
At present when executing a mod action moderators have to manually write in the text box included in the Post Edit or Delete site window the morivation and the violated guideline, increasing post moderation times and thus reducing the amount moderated.
Similarly when a platform ban moderators have to go and manually emit it directly from the API using a relatively complex and unwieldy interface.
Another issue and inefficiency also arises from the platform ban emission process as when evaluating which type of ban to emit there is no mod action based filter in the mod action list found in every user profile to filter such actions.

Opportunities for efficiency
Adding a tickbox list of all guidelines in the mod action window would allow a moderator to tick the violated guidelines and then add additional context in the text box already present at time of writing, allowing for a faster moderation, a higher amount of moderated posts and an overall more professional and standardized moderation as all mod actions would be made upon the same format.
Introducing a Ban site window - with the same functions and requirements present in the API - to be opened via a button included in every user's profile would allow for a faster and safer ban emission as the interface would be much more user-friendly and use of a code based chapcha action confirmation and verification system to prevent bans being emitted by mistake.
Including filter functionalities in the mod action history window present in all user profiles would allow for a faster and more effective evaluation of all ban cases and therefore for better and more accurate decisions to be emitted reducing the risk of unjust bans being issued.

A better future
With such changes introduced an implemented the server wide moderation would become much smoother and efficient, increasing the moderated posts rate and the professionality of the moderation team.
Overall - in short - albeit small in entity these changes would be a major game changer for WOWS Karma's moderation team.

Wrong redirect to wows-numbers for some profiles on Asia & NA

Describe the bug
For NA & ASIA profile pages, the hyperlinks for Statistics don't redirect to the correct server on wows-number.

To Reproduce
Steps to reproduce the behavior:

  1. For example, go to this player's profile on NA page
  2. Click on Statistics :View on wows-numbers.com
  3. Instead of https://na.wows-numbers.com/player/1040858123,guessmyname123 , it gets redirected to https://wows-numbers.com/player/1040858123,guessmyname123 which is an invalid link because there's no user with such ID on wows-number's EU page.

Expected behavior
It should redirect to https://na.wows-numbers.com/player/1040858123,guessmyname123

Screenshot
Example for NA

Desktop

  • OS: Windows 9
  • Browser Chrome
  • Version 108.0.5359.125

(API) Database connection leak

For now several weeks, APIs have been hit with a Connection leak issue, that has been grinding all DB-related requests down to a dead halt once a leak has hit all available connections of a pool.

After a moment, this type of Exception gets thrown:

[03:12:22 ERR] Connection id "0HMBHR8BBDTFA", Request id "0HMBHR8BBDTFA:00000002": An unhandled exception was thrown by the application.
Microsoft.EntityFrameworkCore.Storage.RetryLimitExceededException: The maximum number of retries (6) was exceeded while executing database operations with 'NpgsqlRetryingExecutionStrategy'. See the inner exception for the most recent failure.
 ---> Npgsql.NpgsqlException (0x80004005): The connection pool has been exhausted, either raise 'Max Pool Size' (currently 100) or 'Timeout' (currently 15 seconds) in your connection string.
 ---> System.TimeoutException: The operation has timed out.
   at Npgsql.ConnectorPool.<Get>g__RentAsync|29_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnection.Open()
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass28_0`2.<Execute>b__0(DbContext context, TState state)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
   at WowsKarma.Common.Models.DTOs.AccountKarmaDTO.ToDictionary(IEnumerable`1 values) in D:\Code\Source\WoWS-Karma\WowsKarma.Common\Models\DTOs\AccountKarmaDTO.cs:line 13
   at WowsKarma.Api.Controllers.PlayerController.FetchKarmas(UInt32[] ids) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Controllers\PlayerController.cs:line 56
   at lambda_method116(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WowsKarma.Api.Middlewares.RequestLoggingMiddleware.Invoke(HttpContext context) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Middlewares\RequestLoggingMiddleware.cs:line 52
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
[03:12:23 ERR] An error occurred using the connection to database 'WowsKarma-Api-NA' on server ''.

Several fixes have been deployed to attempt issue mitigation, but in vain. The only clearance that this issue has is periodic restarts of an API by affected region.

Issue must be fixed ASAP, however no root cause has been found, as of yet.

Mod-Edit functionality on Website

Community Managers have made numerous requests for a Mod-Edit functionnality to be made, so that posts can be edited rather than removed, which would be more useful for mitigating small infractions, and be less destructive than a Mod-Removal.

Issue opened to keep track of progress.

Epic: Decouple API code sections

Problem:

Certains parts of a request's flow are not contingent for it's success or failure, and can be invoked in an auxiliary manner.
However, the current implementations consider them as integral parts of the flow, meaning that any failure in these auxiliary components (e.g: Notifications) will result in a request failure, even if the essential elements of a request were fullfilled.

Objective:

These code sections should be switched to event-driven executions, triggered before/after a request's essential flow is invoked.

One easy way to implement this would be through the use of Hangfire, which allows for job triggering, in a fire-and-forget style. Further expanding on this conjecture, more parts of the code could rely on this approach for heuristic-based executions (e.g: database trimming, etc).

Workload

Posting is broken

As of v0.15, posting abilities are broken, on some profiles.

Creating a post yields a 500 (Internal Server Error) message on web, and this stacktrace on API:

System.InvalidOperationException: The instance of entity type 'Clan' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState entityState, Boolean acceptChanges, Boolean modifyProperties, Nullable`1 forceStateWhenUnknownKey)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.NavigationReferenceChanged(InternalEntityEntry entry, INavigationBase navigationBase, Object oldValue, Object newValue)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntryNotifier.NavigationReferenceChanged(InternalEntityEntry entry, INavigation navigation, Object oldValue, Object newValue)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectNavigationChange(InternalEntityEntry entry, INavigationBase navigationBase)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.LocalDetectChanges(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager)
   at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges()
   at Microsoft.EntityFrameworkCore.DbContext.TryDetectChanges()
   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)
   at WowsKarma.Api.Services.PlayerService.GetPlayerAsync(UInt32 accountId, Boolean includeRelated, Boolean includeClanInfo, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Services\PlayerService.cs:line 96
   at WowsKarma.Api.Controllers.PostController.CreatePost(String postDto, IFormFile replay, Boolean ignoreChecks) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Controllers\PostController.cs:line 161
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WowsKarma.Api.Middlewares.RequestLoggingMiddleware.Invoke(HttpContext context) in D:\Code\Source\WoWS-Karma\WowsKarma.Api\Middlewares\RequestLoggingMiddleware.cs:line 49

This needs urgent attention.

Feature: Metrics calculation system overhaul

Context

When a user submits a post, this post is liable to change metrics on another user. This metric change is currently reactively "hand-calculated" by a service, and does not rely on any proactive method.

Problem

Any exception thrown between post submission and profile metrics update can and will invalidate any current metric, rendering it inaccurate.

Solution

The metrics calculation system should be changed for a proactive method (DB counts for example), to increase robustness in metrics readouts.

Unable to open clan page

Unable to open Krama page for -WD-
https://na.wows-karma.com/clan/1000081551,-WD--Well%20Done!

System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at WowsKarma.Web.Services.ClanService.FetchClanProfileFullAsync(UInt32 id) in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Services\ClanService.cs:line 39
   at WowsKarma.Web.Pages.Clans.ClanView.OnParametersSetAsync() in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Pages\Clans\ClanView.razor:line 134
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Also unable to log in. Creating separate issue for that.

Cant upload replays

https://wows-karma.com/player/565892295,laurentp_1/

16/03/22 11:48
image

System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at WowsKarma.Web.Services.PostService.SubmitNewPostAsync(PlayerPostDTO post, IBrowserFile replayFile, CancellationToken ct) in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Services\PostService.cs:line 105
   at WowsKarma.Web.Pages.Posts.EditorModal.ModalSubmitAsync() in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Pages\Posts\EditorModal.razor:line 162

Create an api endpoint to be used in the wows-monitor

The endpoint should take multiple account ids.
GET /gibkarma?ids=1,2,3,4
or
POST /gibkarma with a json body [1,2,3,4].

It should return and array of ids+site karma

[
 {
   id: 1,
   karma: 200
 },
 {
   id: 2,
   karma: 20
 }
]

Modularize notifications output for Discord Webhooks

Problem:

During development time, Discord webhooks are sometimes an unnecessary chain in the workflow of an API request, and can cause more complexity in setup. A developer should be able to turn them off when developing other features, enabling them only when needed.

Objective:

Discord Webhook interactions should be parameterized, and rendered optional, within any request made.

[API] AccountId "0" left unfiltered

WOWS Monitor integration reveals an issue with "vortex.worldofwarships.* GET /api/accounts/0/", due to unfiltered AccountId, default value used by Bots.

Issue is not critical for operations, but should be fixed to prevent further 404 responses being thrown back to the API.

Epic: Replay rendering

Currently a napkin idea, but we could programmatically render replays for posts made on WOWS Karma.

While a render of the minimap is made possible (Thanks to this project: https://github.com/imkindaprogrammermyself/renderer-bot-rq), it can also be a good idea to selectively, or collectively, render the entire replay, from a game client. This would allow for easier referencing of a game event within a post, who could attach a gamestamp.

I will be conducting extensive researches to determine the feasability of this endeavour, as this is no small task.

Edit function is not working

Describe the bug
When you try to edit a post (as user) to fix for example a typo, you correct it and by pressing submit it doesnt get refreshed and the window stays open.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any post you created
  2. Click on Edit post
  3. Edit the part you want to edit
  4. Confirm that you have read the guidelines
  5. Press Create

DB Timestamps change cause Profile lookup failures

A user on Discord has reported the inability to load profiles on Web, as the site throws 500 when loading specific profiles.
Example of affected profile: https://asia.wows-karma.com/player/2020128522,W0wow/

It is estimated that profiles that aren't yet stored on Database are affected by this issue.

Issue is found to be API-Bound, and related to the database, as found by this error in API logs:

[10:01:44 ERR] HTTP/1.1 GET /api/player/2020128522 by 192.168.0.254, responded 500 in 387.22 ms
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details.
 ---> System.InvalidCastException: Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.

Further research points to this breaking change in the DB Driver (in Npgsql.Efcore, v6.0-rc1), as highlighted here:
https://www.npgsql.org/efcore/release-notes/6.0.html#major-changes-to-timestamp-mapping

Clan not found on Wows-Karma

Describe the bug
When searching for a clan (like HABUS) the site will show a list of found clans but clicking on them redirects you to the clan page with the error "404 Sorry, no clan was found."

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'wows-karma.com
  2. Click on 'Clans'
  3. Type in the clantag you are searching
  4. Click on your desired clan
  5. See error

Expected behavior
Seeing a list of all clanmembers, their rank inside the clan and their ingame & site karma.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser [Opera GX]

Clan tag not updating in wows karma platform

Hello valued dev and mods,

This is not a priority issue. The clan tag in wows karma is not updating after a clan change. It does not affect posting nor is it that important , just giving you a heads up.

Unable to log in

Unable to log in.

Log in page shows and brings me to wargaming for confirmation. After hitting continue, page goes to white with below:

https://api.na.wows-karma.com/api/auth/wg-callback?redirectUri=https://na.wows-karma.com/clan/1000081551,-WD--Well%20Done!&openid.error=None&openid.mode=error&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0

{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.3","title":"Forbidden","status":403,"traceId":"00-30ffa49ef5614c183bba576335e97153-4582e9826a90ae08-00"}

Unable to create new posts - "Create" button unresponsive

07/09/22 17:27 Win10 Opera GX browser

https://wows-karma.com/player/502087401,1985miki

Console:

Loaded Authentication data: Object
main.2bc5c873367dc2d7.js:1 Connected to Notifications hub.
main.2bc5c873367dc2d7.js:1 Array(0)
main.2bc5c873367dc2d7.js:1 Connected to Posts hub.
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
2main.2bc5c873367dc2d7.js:1 blurred
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
502087401,1985miki:1 Uncaught (in promise) Object
2main.2bc5c873367dc2d7.js:1 blurred
main.2bc5c873367dc2d7.js:1 ERROR DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
at jv.setProperty (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:159968)
at e.setProperty (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:183547)
at e.writeValue (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:184917)
at t (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:201522)
at https://wows-karma.com/main.2bc5c873367dc2d7.js:1:206395
at Array.forEach ()
at ds.setValue (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:206384)
at ds.patchValue (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:206494)
at e.handleFileInput (https://wows-karma.com/main.2bc5c873367dc2d7.js:1:493053)
at https://wows-karma.com/main.2bc5c873367dc2d7.js:1:494197
handleError @ main.2bc5c873367dc2d7.js:1
502087401,1985miki:1

image
image
image

OPT-Out option not working / doesnt get saved

Describe the bug
The OPT-Out version doesnt work. When clicking on the checkbox, the save button is not clickable.

To Reproduce
Steps to reproduce the behavior:

  1. Go to your profile settings on wows-karma
  2. Click the checkbox for opt out option
  3. Scroll down to the save button
  4. Save button is greyed out and it doesnt save the opt-out feature

Expected behavior
Save button should be clickable and the opt-out option should be saved

Screenshots
wows-karma opt out verison not working

Desktop (please complete the following information):

  • OS: Windows 10 or above
  • Browser: Opera GX

Feature: ModAction standardized reasons (reasons checkboxes)

Problem

At present moderation takes place via a textbox where moderators have to manually type in the motivation of the mod action, making moderation long, time consuming and non-standardized.

Solution

Add before the textbox a checkbox list of all the guidelines, so that moderators only have to tick the boxes corresponding to the violated guidelines and then can add in the textbox addtional context when and if needed. The final moderation message will thus be generated automatically by the website by combining the checked boxes and the additional motivation.

Posts no showing as expected

Describe the bug
Posts are sometimes not shown properly.

To Reproduce
Steps to reproduce the behavior:
Visit that page : https://wows-karma.com/posts/ffdebf38-42f6-4759-a815-164f23393830

Expected behavior
Text should appear, what the player who reported the other player with a decription, also chatlog and team list should be visible.

Screenshots

Bild_2024-02-24_012349796

Desktop (please complete the following information):

  • OS: [Windos 11 Pro (24H2)]
  • Browser [Opera GX]

API returns errors while fetching specific Player profiles

https://wows-karma.com/player/550230795,gagapotapac/

19/03 17:26

System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at WowsKarma.Web.Services.PlayerService.FetchPlayerProfileAsync(UInt32 id) in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Services\PlayerService.cs:line 48
   at WowsKarma.Web.Pages.Players.Profile.OnParametersSetAsync() in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Pages\Players\Profile.razor:line 182
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Also,

https://wows-karma.com/player/555106330,WalaMiStopy/

19/03 17:27

System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at WowsKarma.Web.Services.PlayerService.FetchPlayerProfileAsync(UInt32 id) in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Services\PlayerService.cs:line 48
   at WowsKarma.Web.Pages.Players.Profile.OnParametersSetAsync() in D:\Code\Source\WoWS-Karma\WowsKarma.Web\Pages\Players\Profile.razor:line 182
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Feature: ModScout system

Context

Current moderation flow involves manually checking each and every new post submitted to the platform. With human verification being at the center of the process, mishaps and oversights can easily happen.

Problem

As of today, no assistance is given to moderators, aside from posts view containing indicators on replay/roster correlations.

Solution

An adivsory system for moderation, dubbed the ModScout system, should be implemented.

This system would initally pick up on the two current indicators found in modview :

  • Replay status
    Asserts the presence of both players in a post's attached replay (see Posting Guideline 7: Provide valid evidence)
  • Chat messages
    Given a post with a non-neutral Courtesy flair, asserts the presence of a message from the targeted player. Also asserts the lack of a previous chat message from the author in case of negative courtesy flair (see Posting Guideline 9: Ex turpi causa).

Adding rules to the modscout system should be accounted within design, allowing for new rules to be easily implemented.

Notifications of post advisories would be delivered through a new Discord webhook system, pending further development of a moderation dashboard. Furthermore, they should be able to be viewed in-post.

Pending status of a ModScout advisory should be dependent on the presence of mod-actions on a given post. Any post that had been deleted or moderated should not generate any advisories, and any current advisories should be considered as acknowledged.

Further integration of this system with proposal #160 could be considered, allowing a one-click solution for non-compliant posts mod removal.

Epic: API Unit/Integration Testing

Context:

Developing a new feature doesn't always yield on first try. There can be unexpected bugs/errors, within said feature, or any related feature (regressions).

Problem:

Currently, we need to test manually, or expose ourselves to runtime errors, during production.
How can we detect those bugs before deployment ?

Objective:

We need to predict broken features, with tests.

We must check our features prior to a new update/release. This should be done automatically.

Targets:

  • Minimum code coverage of 80%, then raised to 90% at a later stage.
  • Manual review from stakeholders, per new implemented features.

Conjectures:

Unit & Integration testing answers this issue, by trading off time for stability, and reducing the amount of bugs found in production/live ops.
This also has the additive side effect of making code more reusable, and pushing the developer towards Test Driven Development, which aids with clear feature implementations.

Karma calculation is broken

Several issues have been spotted in regards to Karma & Flairs calculation, on any post change. Changes to Karma/Flairs are not reflected. This is caused by an unknown factor, which will be investigated ASAP.

This issue's resolution takes top priority, as it relates to production-deployed code, and severely impacts the creation of any and all posts.

Scroll bug

If the 25/50/100 post-per-page setting is selected, there is a bug where the first 10 posts seem to disappear when scrolling down the page and then are replaced with the other 10 new posts. The posts should appear continuously when the page is scrolled up and down.

This video is a demonstration of this bug. Please read the video description for more details.

Feature: Post-Replay state validation

Context

During moderation, a Community Manager has no awareness of posts not meeting guidelines, other than by manual validation.

Problem

A Community Manager should be able to systematically know what posts logically fail to meet guidelines, when applicable. Failing to provide such a system, many posts can fly under the radar, and not be picked up by manual verification.

Solution

Automate and implement post-replay state validation, on all possible aspects.

This encompasses player roster checks, flair checks, and chat checks.
Some of these are already implemented app-side, as visual guides (see posts view for any post with replay attached). The objective now is to further expand this API-side, and implement more extensive automated background checks, performed on any new post uploaded.

Deleted post counter visible to moderators

Moderation and deleted posts
The current guidelines for WOWS Karma mandate us - the moderators - to follow a specific and pre-established criterion when issuing suspentions (AKA temporary bans) and bans (AKA permabans), in particular for a suspension to be issued a user must have had at leat 10 of its posts deleted by moderators and for a ban to be issued the amount of deleted posts needed is 20.
This requirement however meets with the problem of the absence of a "deleted/moderated post counter" adavailable to the moderator in order to monitor more efficiently the guideline violation situation of a user therefore impeading any efficient, effective and sistematic enforcement of the aforementioned guideline as we moderators have to rely on the very fallable human memory to keep track of the infractions.

Moderated posts counter
The most immediate solution to this issue would be to include in the user profile page a set of counter that show the detailed statistics for moderator edited and deleted pots for that user. These counters would only be visible to the moderators and would allow for a proper, effective and impartial application of the aforementioned guideline.

Long term possible developments of this feature
Possible future developments of this feature would be a stats only dedicated page of the website being created and made accessible only to moderators to monitor editions and deletions on a server-wide basis and no longer on a individual user basis.

Thanks in advance for considering this issue and its related proposed solution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.