Update PresenceDO tests to match the view-only guest model
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, testing-qa
Direzione di ricerca
Start by running the suite with cd learn && python -m pytest -q to see the 20 failures in learn/tests/test_presence_do.py. Read PresenceDO in learn/src/worker.py (around line 7775) to confirm that ?user_id= sockets are spectators and never enter self.presence, and reuse create_token and the jwt_secret in _make_presence_env for interactive joins. Done means all tests pass, new tests cover spectator acceptance without presence membership and ignored messages plus a 401 for an invalid token, and no ALLOW_ANON_PRESENCE references remain.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
20 tests in learn/tests/test_presence_do.py fail. They were written for an older PresenceDO (learn/src/worker.py ~line 7775) that read an ALLOW_ANON_PRESENCE env flag and added anonymous ?user_id= joiners to presence.
The current code no longer reads ALLOW_ANON_PRESENCE. A socket with a valid ?token= is an interactive participant; a socket with only ?user_id= is accepted as a view-only spectator (can_interact = False) and is never added to self.presence. So tests such as test_accepts_anon_join (expects "bob" in do.presence) and test_rejects_when_anon_disabled_even_with_user_id (expects 401) now fail, and the message/disconnect tests fail because their helpers join as anonymous users.
Run the suite with cd learn && pip install pytest pytest-asyncio && python -m pytest -q (no Cloudflare account needed; tests/conftest.py stubs the Workers runtime).
What to do
- Change the test helpers so interactive users join with a signed token (see
create_tokeninworker.pyand the existingjwt_secretin_make_presence_env). - Rewrite the anonymous-join tests to assert spectator behaviour: socket accepted (101), receives the welcome state, is not in
presence, and its position/emoji/hand-raise messages are ignored. - Remove
ALLOW_ANON_PRESENCEfrom the test env helpers, and delete or rewrite tests that only exercised that flag. - If you believe spectators should be rejected instead, say so in the issue before writing code; don't change
PresenceDObehaviour in this PR.
Acceptance criteria
- All tests in
test_presence_do.pypass. - New tests cover: spectator accepted but not in presence, spectator messages ignored, and an invalid token rejected with 401.
- No
ALLOW_ANON_PRESENCEreferences remain in tests.
Files
learn/tests/test_presence_do.pylearn/src/worker.py (class PresenceDO, ~lines 7775-7990)
Helpful links
Part of GSoC 2027 onboarding — see https://gsoc.alphaonelabs.com
- Lingua principale
- HTML
- Stelle
- 66
- Fork
- 181
- Merge medio
- 2m
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né 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 alphaonelabs/website
-
2026-11 documentation good first issue gsoc-2027 project: gsoc
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
alphaonelabs/website#1154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
2026-11 good first issue gsoc-2027 project: virtual tests
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
alphaonelabs/website#1150 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
2026-11 bug good first issue gsoc-2027 project: mockuper
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alphaonelabs/website#1147 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
2026-11 documentation good first issue gsoc-2027 project: botlab
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
alphaonelabs/website#1144 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
2026-11 documentation good first issue gsoc-2027 project: pmoss
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
alphaonelabs/website#1139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alphaonelabs/website
Issue simili
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
grokability/snipe-it#19996 ·
I maintainer di solito rispondono entro 1 giorno
-
URLValidator ignores an explicit empty scheme allowlistForse già presa @IlyaKhalafi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
tortoise/tortoise-orm#2393 ·
I maintainer di solito rispondono entro 2 giorni
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of onceForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni