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

Corrección de falla al intentar cargar imagen de fondo #132

Merged
merged 6 commits into from
Mar 20, 2024

Conversation

mind-ar
Copy link
Contributor

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

Este PR corrige un error al intentar cargar la imagen de fondo cuando se conecta con el navegador o se realiza un refresh:

2024-03-13T16:17:41,425979282-03:00

Cambios:

  • sketch.js:
    • cuando el frontend está listo (en el método setup()), envía un mensaje "ready" al backend
  • run.ts
    • el backend emite los assets, incluyendo "background" y "cellPixelSize" cuando recibe el evento ready

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

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

Project coverage is 84.28%. Comparing base (cbdfda2) to head (d4e215a).

Files Patch % Lines
src/commands/run.ts 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
- Coverage   84.53%   84.28%   -0.26%     
==========================================
  Files           9        9              
  Lines         666      668       +2     
  Branches      155      155              
==========================================
  Hits          563      563              
- Misses        103      105       +2     

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

@mind-ar mind-ar marked this pull request as draft March 14, 2024 23:54
@mind-ar mind-ar marked this pull request as ready for review March 15, 2024 00:26
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.

Hola @mind-ar

Muchas gracias por el aporte! Ahí dejé una pregunta que me quedó picando.

Sobre el coverage que se está quejando, junto esto del socket es un poco difícil de testear. Igual ya tenemos algunas magias en los tests del run (no sé si los habías visto).

socket = io("http://localhost:3000");
socket = io();
Copy link
Contributor

Choose a reason for hiding this comment

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

Esto qué onda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hola, en #133 se permite utilizar cualquier puerto para games, pero en el frontend estaba forzado a localhost:3000, al dejarlo en blanco toma los datos de la url para iniciar el websocket (sino falla por crossorigin y coso)
Ojo, no sé si esto rompe algun test, si es así puedo buscar alguna alternativa

@PalumboN PalumboN merged commit 782a4fe into uqbar-project:master Mar 20, 2024
1 of 3 checks passed
@mind-ar mind-ar deleted the fix-frontend-background-image branch March 29, 2024 23:45
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.

None yet

2 participants