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

[BE2] Added RumorState handler #1890

Merged
merged 8 commits into from
Jun 3, 2024

Conversation

DanielTavaresA
Copy link
Collaborator

Pending on #1889

When receiving a RumorState query, we send back a response with the list of rumors that are missing from the sender

@DanielTavaresA DanielTavaresA requested a review from a team as a code owner May 28, 2024 16:00
Copy link

Pull reviewers stats

Stats of the last 30 days for popstellar:

User Total reviews Time to review Total comments
K1li4nL
🥇
9
▀▀
5d 1h 1m
23
pierluca
🥈
5
6d 22h 1m
8
onsriahi14
🥉
5
3d 1h 48m
10
matteosz
5
4d 1h 8m
22
arnauds5
4
7d 5h 54m
12
simone-kalbermatter
4
1d 14h 46m
0
quadcopterman
4
5d 19h 9m
1
Tyratox
2
27d 19h 54m
▀▀▀
48
▀▀▀
1florentin
2
8d 13h 48m
6
t1b00
2
6d 6h 52m
4
osm-alt
2
6d 22h 53m
12
ljankoschek
2
18m
0
DanielTavaresA
2
2d 10h 22m
8
Kaz-ookid
2
7d 15h 16m
7
sgueissa
1
6d 11h 44m
1
MariemBaccari
1
1d 16h 52m
0
emonnin-epfl
1
51m
1
⚡️ Pull request stats

@DanielTavaresA DanielTavaresA changed the base branch from master to work-be2-daniel-response-pull-state-json May 28, 2024 16:01
Base automatically changed from work-be2-daniel-response-pull-state-json to master May 29, 2024 08:49
onsriahi14
onsriahi14 previously approved these changes May 29, 2024
Copy link
Contributor

@onsriahi14 onsriahi14 left a comment

Choose a reason for hiding this comment

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

Clear and clean code!

Copy link
Contributor

@K1li4nL K1li4nL left a comment

Choose a reason for hiding this comment

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

Went quickly over it but looks good to me overall, just a few nitpicks and should be good to merge

Comment on lines 9 to 18
import ch.epfl.pop.model.network.method.message.Message
import ch.epfl.pop.model.network.method.{GreetServer, Rumor}
import ch.epfl.pop.model.network.method.{GreetServer, Rumor, RumorState}
import ch.epfl.pop.model.network.{JsonRpcRequest, JsonRpcResponse, MethodType}
import ch.epfl.pop.model.objects.{Base64Data, Channel, PublicKey, RumorData}
import ch.epfl.pop.pubsub.AskPatternConstants
import ch.epfl.pop.pubsub.ClientActor.ClientAnswer
import ch.epfl.pop.pubsub.graph.validators.RpcValidator
import ch.epfl.pop.pubsub.graph.{ErrorCodes, GraphMessage, PipelineError}
import ch.epfl.pop.storage.DbActor
import ch.epfl.pop.storage.DbActor.{DbActorAck, DbActorReadRumor, DbActorReadRumorData}
import ch.epfl.pop.storage.DbActor.{DbActorAck, DbActorGenerateRumorStateAns, DbActorReadRumor, DbActorReadRumorData}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure these imports are necessary ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably there from an old version, will remove

Comment on lines -46 to -60

test("constructor from json works for RumorState") {
val state: Map[PublicKey, Int] = Map(
PublicKey(Base64Data.encode("1")) -> 1,
PublicKey(Base64Data.encode("2")) -> 2,
PublicKey(Base64Data.encode("3")) -> 3
)

val rumorState: RumorState = RumorState(state)

val encodedDecoded = RumorState.buildFromJson(rumorState.toJsonString)

encodedDecoded.state shouldBe state
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why delete that ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to RumorStateSuite apparently

Copy link

sonarcloud bot commented Jun 2, 2024

Quality Gate Passed Quality Gate passed for 'PoP - PoPCHA-Web-Client'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 2, 2024

Copy link

sonarcloud bot commented Jun 2, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Be1-Go'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 2, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Fe1-Web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 2, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Fe2-Android'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@K1li4nL K1li4nL left a comment

Choose a reason for hiding this comment

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

LGTM

@K1li4nL K1li4nL added this pull request to the merge queue Jun 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 3, 2024
@DanielTavaresA DanielTavaresA added this pull request to the merge queue Jun 3, 2024
Merged via the queue into master with commit 86a7b63 Jun 3, 2024
18 checks passed
@DanielTavaresA DanielTavaresA deleted the work-be2-daniel-pull-rumor-handler branch June 3, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants