Skip to content

[Bug] Major data regression caused by incorrect categorisation #875

@DopiGFX

Description

@DopiGFX

Describe the bug

Many items have missing data due to an incorrect categorisation by the parser.mjs

NodeJS Version

lts

npm Version

lts

@wfcd/items Version

v1.1272.133

Access Method

github download

What happened?

I noticed a major data regression caused by an incorrect categorisation in parser.mjs

I was playing around with arcanes when I noticed, some had the attribute "rarity" missing.
On the journey to find the issue, I found an incorrect categorisation of items, but I cannot tell how far this goes on.

Here's an explanation of the issue, on the example of arcanes:

This function adds the data to an item, with a given category:

filter(original, category, data) {

In this line, the category set in the item can change:

this.addCategory(result, category);

But the original given category is NOT reassigned to the new one

Some functions afterwards are also passed a category, in this case the ORIGINAL one:

this.addAdditionalWikiaData(result, category, data.wikia);
this.addIsPrime(result);
this.addVaultData(result, category, data.wikia);
this.addResistanceData(result, category);

In case of this function, it is in first place missing the "arcane" property in the first line (which is another issue I'll create afterwards), but it is also comparing with the ORIGINAL category:

addAdditionalWikiaData(item, category, wikiaData) {

This function is essential:

addCategory(item, category) {

It changes "RelicArcane" into the correct category:
case 'RelicArcane':
if (item.type !== 'Relic') item.category = 'Arcanes';
else item.category = 'Relics';

And also the category of "Upgrades" and "Warframes" is changed:
case 'Upgrades':
item.category = 'Mods';
if (item.compatName !== 'Warframe' && item.type === 'Warframe Mod') item.isAugment = true;
break;
case 'Warframes':
if (item.isArchwing) item.category = 'Archwing';
else item.category = 'Warframes';
item.isArchwing = undefined;
break;

This also results to "upgrades" appearing falsely in this list, next to "mods":

if (!['weapons', 'warframes', 'mods', 'upgrades', 'sentinels'].includes(category.toLowerCase())) return;

This part is "fixing" the issue I described above for at least some items, but I don't think this is the correct solution here, scince the issue starts way before:

let wikiCategory = category.toLowerCase();
if (category === 'Upgrades') wikiCategory = 'mods';
if (item.category === 'Archwing') wikiCategory = 'archwings';
if (category === 'Sentinels') wikiCategory = 'companions';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scope: Out of ScopeNot provided by DE's APISeverity4: InconvenientThe defect does not affect functionality or critical data. It is merely an inconvenience.Type: Bughelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions