test: user-subscription specs fail outside UTC, so the pre-commit hook cannot pass
I maintainer di solito rispondono entro 1 giorno
@tejasvasingh2004 ci sta già lavorando.
Dal 25/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- testing
Direzione di ricerca
Inizia da test/unit/repositories/user-subscription-repository.spec.ts ed eseguilo sia con TZ=UTC sia con TZ=America/Toronto per riprodurre i cinque errori. Segui il modo in cui gli spec costruiscono le date limite e il modo in cui il driver delle query le rappresenta; rendi il limite indipendente dal fuso orario locale e verifica il valore passato al driver. Il lavoro è completato quando tutti i 17 spec passano in entrambi i fusi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
test/unit/repositories/user-subscription-repository.spec.ts passes under TZ=UTC and fails under any negative-offset zone, so the pre-commit hook cannot pass for anyone running outside UTC — including this development environment, which is America/Toronto.
$ TZ=UTC npx mocha test/unit/repositories/user-subscription-repository.spec.ts
17 passing
$ TZ=America/Toronto npx mocha test/unit/repositories/user-subscription-repository.spec.ts
12 passing, 5 failing
AssertionError: expected 'select * from "user_subscriptions" wh…' to include '"current_period_end" <= '2026-01-31'
All five are the same defect: the specs build a boundary date and assert the literal 2026-01-31 appears in the generated SQL, but the driver renders the value in the local zone, so at UTC-5 the SQL carries a different instant. The two updateIfCurrent failures are the same cause in the IS NOT DISTINCT FROM clause.
CI is UTC, so main is green and the problem is invisible there. It only appears locally, as a pre-commit failure that looks like the change under test is broken.
Fix direction: make the boundary explicit rather than ambient — construct the dates in UTC (or set process.env.TZ = 'UTC' before the module under test is imported, which Node honours for later Date work) and assert on the value the driver is given, not on a date literal that only matches in UTC.
Found while committing an unrelated compose fix (#929).
- Lingua principale
- TypeScript
- Stelle
- 829
- Fork
- 234
- Merge medio
- 17h 6m
- PR unite (30g)
- 92
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cameri/nostream
-
factory rewrite rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
factory rewrite rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cameri/nostream#991 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug factory rewrite rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cameri/nostream#960 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug factory rewrite rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug factory rewrite rust
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cameri/nostream
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
grafana/profiles-drilldown#1212 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grafana/traces-drilldown#980 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openremote/openremote#3487 · 1 commento ·
-
triage:needs-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
garrytan/gbrain#7635 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
coollabsio/jean#867 ·
I maintainer di solito rispondono entro 1 giorno