Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: duplicated flushEvent on reload #136

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

mind-ar
Copy link
Contributor

@mind-ar mind-ar commented Mar 15, 2024

  • Cada vez que se da reload el juego empieza a andar más rápido, debido a que se acumulan los setInterval
    • Este fix agrega un clearInterval cada vez que se recibe una desconexión
    • Nota: esto no soluciona el caso de que se abran dos solapas
  • también se corrige una diferencia en el setInterval que llama a flushEvent: el setInterval se ejecutaba cada 100ms, pero el timer que se pasaba a wollok incrementaba en 300 ms, esto provocaba que los onTick no se ejecuten correctamente

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 85.26%. Comparing base (bcf4129) to head (0f41fec).

Files Patch % Lines
src/commands/run.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   85.63%   85.26%   -0.37%     
==========================================
  Files           9        9              
  Lines         696      699       +3     
  Branches      161      161              
==========================================
  Hits          596      596              
- Misses        100      103       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PalumboN PalumboN self-requested a review March 20, 2024 23:17
Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buenísimo el fix! 💯

A mí no me convence la implementación con el setInterval en el server.
Para mí eso lo debería manejar j5 en su loop (expone una función para eso).

Por ahora esto está bien, pero si te parece en alguna reunión me gustaría que pensemos alguna implementación alternativa que no necesite que server y cliente estén timeados.

@PalumboN PalumboN merged commit b067e56 into uqbar-project:master Mar 20, 2024
1 of 3 checks passed
@mind-ar mind-ar deleted the fix-flushevents branch March 22, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants