mysql2 breakage
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript, node.js
Piste de recherche
Start by tracing database.setUserPrefs, database.getUserPrefs, and database.getReadingListsInfo in feedlanddatabase, then inspect the mysql2 setup in davesql's start function. Reproduce the affected JSON preference queries with mysql and mysql2, and verify that the affected operations work without failing when mysql2 returns JSON values as objects.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Background: I usually won't swap out one NPM package for another, because it's virtually impossible to find all the problems even if the developers placed a premium on no breakage. I made this optional change because it was required by Automattic for the server system we are using, but I was afraid something like what happened would happen.
A breaking change in mysql2
- There's a breaking change in mysql2, when transitioning from mysql.
- If you use the JSON type, when a query returns such a value, in mysql it is a string, in mysql2 it's a JavaScript object.
- The FeedLand code is expecting a string, and fails when we try to run the object through
JSON.parse, which of course is correct.
Where this breaks FeedLand
- database.setUserPrefs
- database.getUserPrefs
- database.getUserPrefs
- database.getReadingListsInfo
I just looked in feedlanddatabase.
I've turned off using mysql2 on the test server I am working on. Not sure what the fix is going to be for servers that want to or have to use mysql2.
I tried adding jsonAsObject set false to the connection record in the start function in the davesql package, but that doesn't seem to have done anything.
console.log ("davesql.start: using " + ((config.flUseMySql2) ? "mysql2" : "mysql") + "."); //4/12/24 by DW
mysql = (config.flUseMySql2) ? require ("mysql2") : require ("mysql"); //4/12/24 by DW
if (config.flUseMySql2) { //6/27/24 by DW
options.jsonAsObject = false;
}
theSqlConnectionPool = mysql.createPool (options);
- Langage dominant
- HTML
- Étoiles
- 11
- Forks
- 4
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de scripting/feedlandInstall
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
scripting/feedlandInstall#79 · 1 commentaire · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 55/100
scripting/feedlandInstall#77 · 3 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
scripting/feedlandInstall#76 · 3 commentaires ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 20/100
scripting/feedlandInstall#74 · 3 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
scripting/feedlandInstall#73 · 1 commentaire ·
Toutes les issues de scripting/feedlandInstall
Issues similaires
-
area: capture good first issue priority: P2 type: defect
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
jiegui2025/hwspec#51 ·
Les mainteneurs répondent en général sous 1 jour
-
[Feature]:Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
thephpleague/commonmark#1159 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
Uuriko/project-room#1554 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
EchoTools/nevr-runtime#117 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour