Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

mysql2 breakage

Aperta
#60 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
backend, databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
  1. There's a breaking change in mysql2, when transitioning from mysql.
  2. 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.
  3. 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
  1. database.setUserPrefs
  2. database.getUserPrefs
  3. database.getUserPrefs
  4. 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);

Lingua principale
HTML
Stelle
11
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scripting/feedlandInstall

Tutte le issue di scripting/feedlandInstall

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.