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: Fix badges disappearing randomly #1671

Merged
merged 12 commits into from
Jun 16, 2022
Merged

fix: Fix badges disappearing randomly #1671

merged 12 commits into from
Jun 16, 2022

Conversation

faucomte97
Copy link
Member

@faucomte97 faucomte97 commented Jun 6, 2022

Description

Fixes a bug whereby the last badge earned disappears when submitting the code again, under certain conditions that haven't been fully determined.

How Has This Been Tested?

Manually


This change is Reviewable

@faucomte97 faucomte97 self-assigned this Jun 6, 2022
@faucomte97 faucomte97 marked this pull request as ready for review June 7, 2022 20:37
Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97)


game_frontend/cypress/integration/avatarWorker/codeExecution.spec.js line 68 at r2 (raw file):

      .its('consoleLog.logs')
      .then(logs => {
        const log = logs.entries().next().value[0]

Why has this changed?


game_frontend/src/pyodide/badges.ts line 21 at r2 (raw file):

  result: ComputedTurnResult,
  userCode: string,
  gameState: any

This needs a comma at the end of it I think. (So you don't use prettier do you?)

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 2 files at r2, 11 of 11 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97)

Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 12 files reviewed, 2 unresolved discussions (waiting on @dionizh and @razvan-pro)


game_frontend/src/pyodide/badges.ts line 21 at r2 (raw file):

Previously, dionizh (Dioni Zhong) wrote…

This needs a comma at the end of it I think. (So you don't use prettier do you?)

Done.
Actually, Prettier removed it 😬


game_frontend/cypress/integration/avatarWorker/codeExecution.spec.js line 68 at r2 (raw file):

Previously, dionizh (Dioni Zhong) wrote…

Why has this changed?

Reverted it

Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 11 files at r3, 2 of 2 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97)


game_frontend/src/components/NavigationBar/index.js line 81 at r6 (raw file):

        }
      }
      // return current badges

Can you add a comment about this is for the initialisation when game loads? So this is called when gameState changes from undefined to not undefined, right?


game_frontend/src/pyodide/badges.ts line 21 at r2 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Done.
Actually, Prettier removed it 😬

Oh sorry this is a function parameter. I think I was thinking of object/dict.

Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dionizh)


game_frontend/src/components/NavigationBar/index.js line 81 at r6 (raw file):

Previously, dionizh (Dioni Zhong) wrote…

Can you add a comment about this is for the initialisation when game loads? So this is called when gameState changes from undefined to not undefined, right?

I've update the comment, it's not for when the gameState changes but for when the props and the state is the same (aka no new badge)

Copy link
Contributor

@dionizh dionizh left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r8, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)

@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #1671 (c296b7a) into master (4c6af7b) will increase coverage by 20.62%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1671       +/-   ##
===========================================
+ Coverage   67.32%   87.95%   +20.62%     
===========================================
  Files         171       38      -133     
  Lines        3532     1046     -2486     
  Branches      298      159      -139     
===========================================
- Hits         2378      920     -1458     
+ Misses       1122      103     -1019     
+ Partials       32       23        -9     
Impacted Files Coverage Δ
game_frontend/src/components/Badge/index.js
...ame_frontend/src/components/NavigationBar/index.js
game_frontend/src/pyodide/badges.ts
...rontend/src/redux/features/AvatarWorker/actions.js
..._frontend/src/redux/features/AvatarWorker/epics.js
...ontend/src/redux/features/AvatarWorker/reducers.js
..._frontend/src/redux/features/AvatarWorker/types.js
...e_frontend/src/testHelpers/dummyImportMeshAsync.ts
aimmo/permissions.py
...mo/management/commands/delete_generated_players.py
... and 125 more

@faucomte97 faucomte97 merged commit 10cabe7 into master Jun 16, 2022
@faucomte97 faucomte97 deleted the badges_disappearing branch June 16, 2022 15:28
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

3 participants