This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
Klasa SQLProvider class does not check for instanceof MemberGateway in klasa-member-gateway #867
Open
1 of 2 tasks
Labels
Bug: Confirmed
Issues that report confirmed bugs.
Mod: SettingsGateway
Issues and PRs related to SettingsGateway.
Describe the issue
The SQLProvider class of Klasa.js conflicts with klasa-member-gateway MemberGateway class. When executing the parseEntry function, line 102 only checks for instanceof Gateway, which returns false for a MemberGateway via klasa-member-gateway. As a result, the returning data is a TextRow class when expected a Javascript Object. This is a problem for providers such as MySQL because arrays do not get properly parsed from JSON strings in this condition.
Code or steps to reproduce
Line 102 of src/lib/structures/SQLProvider
Expected and actual behavior
Expected behavior:
*Values/arrays in guildMember.settings via klasa-member-gateway with the MySQL provider are properly parsed just as other settings (such as guild.settings and user.settings) are.
Actual behavior:
*While non-MemberGateway settings are properly parsed and returned as objects, MemberGateway settings are not properly parsed as objects and instead returned as a TextRow. Furthermore, when using in conjunction with schema-script SQL providers such as MySQL, arrays are not properly parsed... they are either strings when there are more than one entry, or they are "undefined" when there are no entries.
Further details
The text was updated successfully, but these errors were encountered: