Luzefiru / wuwatracker

wuwatracker.com - A Collection of Wuthering Waves Tools; Pity Tracker, Ascension Planner, Game Calendar, Database and more!
https://wuwatracker.com
127 stars 39 forks source link

UI crashes during import (Unhandled Runtime Error) #35

Closed Sven-Lyco closed 3 months ago

Sven-Lyco commented 3 months ago

Bug Description

When clicking on Import to import the history, the application crashes

How to Reproduce

A reproduction repository is greatly appreciated. Steps to reproduce the behavior:

  1. Go to 'http://localhost:3000/import'
  2. Copy installation folder "D:\Wuthering Waves\Wuthering Waves Game" ( in my case)
  3. Copy and execute the script for Powershell in Windows Powershell
  4. Copy the give URL into step 3.
  5. Click on 'Import History'
  6. See error

Expected Behavior

The UI does not crash and the import is successful

Screenshots

import Site

grafik

ERROR

grafik grafik grafik grafik

Platform/OS

Desktop (please complete the following information):

Sven-Lyco commented 3 months ago

Okay, I should have read better. I have customized the LanguageCode in src/types/LangaugeCode.ts :

import { z } from "zod";

export const LanguageCode = {
  de: "de",
} as const;
export const LanguageCodeEnumSchema = z.nativeEnum(LanguageCode);
export type LangaugeCodeEnum = z.infer<typeof LanguageCodeEnumSchema>;

And now it works. Maybe it would be an improvement to give a hint about the language settings or the possibility to change the language

Luzefiru commented 3 months ago

This is a good find. The history URL has a languageCode property which I naively set to only allow "en".

It might be worth considering to remove the reliance of languageCode by:

We do not have a reliable way to display localized language results at the moment since we hard code a lot of English values for comparison, so it's best to make this website English only for now until we find a better way.

Is that a workable solution? Regardless, I'd love your help in resolving this, @Sven-Lyco.

Sven-Lyco commented 3 months ago

This is a good find. The history URL has a languageCode property which I naively set to only allow "en".

It might be worth considering to remove the reliance of languageCode by:

* removing it from the data schema & the functions that use it/extract it

* just hard coding `languageCode: "en"` to all requests, see [useConveneHistory's getHistoryByCardPoolType method](https://github.com/Luzefiru/wuwatracker/blob/main/src/hooks/useConveneHistory.ts)

We do not have a reliable way to display localized language results at the moment since we hard code a lot of English values for comparison, so it's best to make this website English only for now until we find a better way.

Is that a workable solution? Regardless, I'd love your help in resolving this, @Sven-Lyco.

I forked your project and will try a different things, but it will take time

Luzefiru commented 3 months ago

I forked your project and will try a different things, but it will take time

Sure thing! I'm looking forward to what other methods you'll find to help support other languages. I'll merge the temporary fix for now since it's affecting users at the moment.

On that note, there's a Data mine repository with all the available languages for experimentation.

Will close this issue now since it works on your machine now. Thank you for raising this issue!🍻