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

[HOTFIX#193] Fixed acceptProposal RPC for not properly cleaning exchanged cards from custom decks #199

Conversation

alessioarcara
Copy link
Owner

@alessioarcara alessioarcara commented Feb 13, 2023

This PR fixes the bug explained in issue #193. Also Refactored acceptProposal RPC for code cleanliness and moved decks updating to separate function updateUserDecks.

…from custom decks. Also Refactored acceptProposal RPC for code cleanliness and moved decks updating to separate function, updateUserDecks
}
}
} else if (deckName.equals(WISHED_DECK)) {
Map<Integer, List<PhysicalCard>> lookUp = deck.getPhysicalCards().stream().collect(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice to have the lookup table included in this method seeing that is used only here

// save
deckMap.put(proposal.getReceiverUserEmail(), receiverDecks);
deckMap.put(proposal.getSenderUserEmail(), senderDecks);
deckMap.put(proposal.getReceiverUserEmail(), DeckServiceImpl.updateUserDecks(deckMap.get(proposal.getReceiverUserEmail()), proposal.getSenderPhysicalCards(), proposal.getReceiverPhysicalCards()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awsome compaction

Copy link
Collaborator

@Matte0Sacc0 Matte0Sacc0 left a comment

Choose a reason for hiding this comment

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

A really great job

Copy link
Collaborator

@dstops dstops left a comment

Choose a reason for hiding this comment

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

Great job, cod is clear and clean. The methods are now much more concise but well-structured.

@alessiacrimaldi alessiacrimaldi merged commit 7556b2f into release/1.0.0 Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants