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

test_app_shell test_04b: the restored reading place lands on a neighbouring note under load

Aperta
#458 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start with useReadingPosition in app/apps/web/src/app/drafts.ts, which restores the scroll place at mount, and with test_04b_reading_position_is_kept_per_view in test_app_shell. First measure the failure rate on main with and without a CPU limit, then find which late layout change moves the place without a DOM mutation (the issue suggests browser scroll anchoring). Done means the restored place stays on the anchored note across the view switch under load, with no test-side waiting that hides the transient state.

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

Descrizione

Found while working on #271 (PR #455). test_app_shell test_04b_reading_position_is_kept_per_view fails intermittently under host load, and the failure is in the product's reading-place restore (app/apps/web/src/app/drafts.ts, useReadingPosition), not in the test's wait logic.

Symptom

At the view switch (Home → Wiki → Conversation) the first visible note is one note above the anchor:

AssertionError: 'Reading position check, note 1: …' != 'Reading position check, note 2: …'
: the same note is at the top after a view switch

The instrumented runs below passed with service workers blocked in every context (the state of #455 before its last commit). The base commit e06248c5 passed with service workers allowed, as did one run of the final #455 code. Three module runs of #455 before its last commit failed with service workers blocked, under concurrent UI runs on the host (load not measured).

What the instrumented runs show

The probes were temporary instrumentation of useReadingPosition and were removed afterwards:

  • Save path is fine: the scroll to top 600 with anchor capture-n1 is saved on the next frame.
  • Restore at mount runs while the notes are the only content: restore-before top 0, notes 40, anchor capture-n1, want 600, then restore-after top 358.
  • The place then reaches 600 without a further scroll event and without a MutationObserver callback (no mo-fired entries), so something other than a DOM mutation moves it. Browser scroll anchoring is the leading candidate, not confirmed.
  • Under a 0.3 CPU limit, three reads within about 2 ms returned note 2, then note 1 (scrollTop 358), then note 2 again: the position flaps between neighbouring notes while blocks above the notes render.

CPU-limit measurements (docker update --cpus 0.3 on the UI runner only)

Run Limit Modules Result Note
instrumented none test_app_shell Ran 20 tests in 67.382s / OK save and restore probes, no failure
instrumented 0.3 CPU test_app_shell Ran 20 tests in 215.248s / OK restore-after top 358, later 600
instrumented 0.3 CPU test_app_shell + test_motion test_01 ×3 Ran 23 tests in 98.901s / OK flapping reads 2 → 1 → 2 at the switch
instrumented none test_app_shell Ran 20 tests in 81.455s / OK restore-before top 0, restore-after top 358, read at switch = note 2

Failing runs without a CPU limit (host shared with other UI runs):

  • 24 changed modules: Ran 274 tests in 871.572s / FAILED (failures=2), test_04b and an unrelated test_07b.
  • test_app_shell test_project_surface: Ran 39 tests in 111.446s / FAILED (failures=1), test_04b only.

Base commit e06248c5, same two modules: Ran 39 tests in 96.693s / OK.

Tried, not effective

Both were run in the failing module and both kept failing: overflow-anchor: none on the pane while the place settles, and a ResizeObserver on the pane's column. Neither is in the code.

Not established

Whether the test's service-worker blocking (#455 blocks workers in routing tests only; test_04b now runs with workers allowed, as on main) changes page-load timing enough to expose the transient restore. The evidence so far is not enough to decide.

Suggested next steps

  1. Repeat test_app_shell several times, with a CPU limit and without, to measure the failure rate on current main.
  2. Find which layout change moves the place without a DOM mutation (browser scroll anchoring, images, late styles).
  3. Make the final place independent of those changes, then remove any test-side waiting that would hide the transient state.

Refs #271, PR #455.

Lingua principale
TypeScript
Stelle
3
Fork
0
Merge medio
18h 3m
PR unite (30g)
254

Preparare l'ambiente

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 ColdPhase/flux

Tutte le issue di ColdPhase/flux

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.