From 18af595534816394e3f5cdae54607320c2bbf6a7 Mon Sep 17 00:00:00 2001 From: darshankabariya Date: Wed, 12 Nov 2025 17:48:13 +0530 Subject: [PATCH] chore: initial comment for bumb v0.36.0 and resolve error while running example. --- examples/tic-tac-toe-gui/src/main.rs | 11 +++++++---- waku-bindings/src/node/store.rs | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/examples/tic-tac-toe-gui/src/main.rs b/examples/tic-tac-toe-gui/src/main.rs index 97dbf51..53db0ad 100644 --- a/examples/tic-tac-toe-gui/src/main.rs +++ b/examples/tic-tac-toe-gui/src/main.rs @@ -51,6 +51,7 @@ impl TicTacToeApp { async fn start(self) -> TicTacToeApp { let tx_clone = self.tx.clone(); + let game_content_topic = WakuContentTopic::new("waku", "2", "tictactoegame", Encoding::Proto); let my_closure = move |response| { if let LibwakuResponse::Success(v) = response { @@ -59,8 +60,11 @@ impl TicTacToeApp { match event { WakuEvent::WakuMessage(evt) => { - // println!("WakuMessage event received: {:?}", evt.waku_message); let message = evt.waku_message; + // Filter: only process messages for our game content topic + if message.content_topic != game_content_topic { + return; // Skip messages from other apps + } let payload = message.payload.to_vec(); match from_utf8(&payload) { Ok(msg) => { @@ -254,9 +258,8 @@ impl eframe::App for TicTacToeApp { if ui.button("Play as O").clicked() { self.player_role = Some(Player::O); - if let Ok(mut game_state) = self.game_state.try_lock() { - game_state.current_turn = Player::X; // player X should start - } + // Player O waits for Player X to make the first move + // No need to change current_turn as it's already X } return; // Exit early until a role is selected diff --git a/waku-bindings/src/node/store.rs b/waku-bindings/src/node/store.rs index 91fb60c..fbf48fc 100644 --- a/waku-bindings/src/node/store.rs +++ b/waku-bindings/src/node/store.rs @@ -31,25 +31,25 @@ pub struct PagingOptions { pub struct StoreQueryRequest { /// if true, the store-response will include the full message content. If false, /// the store-response will only include a list of message hashes. - #[serde(rename = "requestId")] + #[serde(rename = "request_id")] request_id: String, - #[serde(rename = "includeData")] + #[serde(rename = "include_data")] include_data: bool, - #[serde(rename = "pubsubTopic", skip_serializing_if = "Option::is_none")] + #[serde(rename = "pubsub_topic", skip_serializing_if = "Option::is_none")] pubsub_topic: Option, - #[serde(rename = "contentTopics")] + #[serde(rename = "content_topics")] content_topics: Vec, - #[serde(rename = "timeStart", skip_serializing_if = "Option::is_none")] + #[serde(rename = "time_start", skip_serializing_if = "Option::is_none")] time_start: Option, - #[serde(rename = "timeEnd", skip_serializing_if = "Option::is_none")] + #[serde(rename = "time_end", skip_serializing_if = "Option::is_none")] time_end: Option, - #[serde(rename = "messageHashes", skip_serializing_if = "Option::is_none")] + #[serde(rename = "message_hashes", skip_serializing_if = "Option::is_none")] message_hashes: Option>, - #[serde(rename = "paginationCursor", skip_serializing_if = "Option::is_none")] + #[serde(rename = "pagination_cursor", skip_serializing_if = "Option::is_none")] pagination_cursor: Option, // Message hash (key) from where to start query (exclusive) - #[serde(rename = "paginationForward")] + #[serde(rename = "pagination_forward")] pagination_forward: bool, - #[serde(rename = "paginationLimit", skip_serializing_if = "Option::is_none")] + #[serde(rename = "pagination_limit", skip_serializing_if = "Option::is_none")] pagination_limit: Option, }