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

Add fetch messages behind a toggle & some advanced settings #18007

Closed
wants to merge 1 commit into from

Conversation

cammellos
Copy link
Contributor

This PR does a few things:

  1. Add fetch messages implementation on any kind of chat. It's behind a
    toggle (on by default) as design is still unsure whether we want it,
    but it's very useful for debugging.
  2. Allow setting light client from mobile

It also partially remove node config management from the clojure part, as it's better if that's not explicitly managed by clients. Some parts are still relying on it but they are not functional (keycard), while others are still using it and will need to be updated eventually (syncing), in order to get rid completely of node config.

status-im/status-go@8a4c2d8...8cf9986

Happy to split if necessary as that's multiple actual features, also it might use outdated conventions etc, let me know if that's the case.

Testing

Just smoke testing to make sure basics are not broken, fetch-messages can be tested but it's a bit difficult, since you would have to replicate message loss, and then fetch from a chat.

@status-im-auto
Copy link
Member

status-im-auto commented Nov 27, 2023

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a76d93e #1 2023-11-27 16:09:52 ~7 min android-e2e 🤖apk 📲
✔️ a76d93e #1 2023-11-27 16:12:07 ~10 min android 🤖apk 📲
✔️ a76d93e #1 2023-11-27 16:15:45 ~13 min tests 📄log
✔️ a76d93e #1 2023-11-27 16:16:29 ~14 min ios 📱ipa 📲
✔️ 0c55577 #2 2023-11-29 11:58:03 ~8 min android 🤖apk 📲
✔️ 0c55577 #2 2023-11-29 11:58:18 ~8 min android-e2e 🤖apk 📲
✔️ 0c55577 #2 2023-11-29 12:03:13 ~13 min tests 📄log
✔️ 0c55577 #2 2023-11-29 12:06:20 ~16 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f03f248 #3 2023-12-01 09:31:23 ~6 min android-e2e 🤖apk 📲
✔️ f03f248 #3 2023-12-01 09:31:27 ~6 min android 🤖apk 📲
✔️ f03f248 #3 2023-12-01 09:31:50 ~7 min ios 📱ipa 📲
✔️ f03f248 #3 2023-12-01 09:36:26 ~11 min tests 📄log
a8408b4 #4 2023-12-07 16:55:53 ~2 min tests 📄log
✔️ a8408b4 #4 2023-12-07 17:00:05 ~7 min ios 📱ipa 📲
✔️ a8408b4 #4 2023-12-07 17:00:45 ~7 min android 🤖apk 📲
✔️ a8408b4 #4 2023-12-07 17:00:57 ~8 min android-e2e 🤖apk 📲

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

It's behind a toggle (on by default) as design is still unsure whether we want it

I'm not aware of what this sync feature is, and I couldn't find any issue in status-mobile or status-go. Here's the status-go PR because it's not linked to the mobile one #18007.

Do you have any source describing what is this feature, what are our intentions, requirements, how it could evolve, and so on? These things would've helped me review the PR.

The code LGTM, I just don't understand where we are going with it.

[...] also it might use outdated conventions etc, let me know if that's the case.

Side note: Some parts of the PR are touching old stuff like advanced settings, that part is too off in terms of guidelines, so I'm not commenting anything about that.

In terms of event handlers, we have agreed to avoid mixing in the same file events using rf/reg-event-fx and rf/defn, so it's okay that in this PR you're going with the flow of rf/defn :)

Edit: formatting


:json-rpc/call [{:method "wakuext_setLightClient"
:params [{:enabled enabled?}]
:on-success #(do
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -449,3 +449,12 @@
{:events [:chat/check-last-chat]}
[{:keys [db]}]
{:chat/open-last-chat (get-in db [:profile/profile :key-uid])})

(rf/defn fetch-messages
{:events [:chat/fetch-messages]}
Copy link
Contributor

Choose a reason for hiding this comment

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

The new endpoint syncs data for the last 30 days, so the word sync seems stronger to me than just fetch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went for FetchMessages everywhere to mirror the UI and be consistent with desktop, hope that's ok

@cammellos
Copy link
Contributor Author

It's behind a toggle (on by default) as design is still unsure whether we want it

I'm not aware of what this sync feature is, and I couldn't find any issue in status-mobile or status-go. Here's the status-go PR because it's not linked to the mobile one #18007.

Do you have any source describing what is this feature, what are our intentions, requirements, how it could evolve, and so on? These things would've helped me review the PR.

The code LGTM, I just don't understand where we are going with it.

[...] also it might use outdated conventions etc, let me know if that's the case.

Side note: Some parts of the PR are touching old stuff like advanced settings, that part is too off in terms of guidelines, so I'm not commenting anything about that.

In terms of event handlers, we have agreed to avoid mixing in the same file events using rf/reg-event-fx and rf/defn, so it's okay that in this PR you're going with the flow of rf/defn :)

Edit: formatting

@ilmotta there's not much documentation, I think product wants to ditch the feature alltogether, but I spoke to John and agreed that is fine to add this (disabled on release when we release). This is helpful for debugging and at least side step some of the issues with network reliability and make dogfooding a bit smoother (it's a patch of course and not a fix).

@cammellos cammellos force-pushed the feature/sync-chat branch 2 times, most recently from 0c55577 to f03f248 Compare December 1, 2023 09:24
This PR does a few things:

1) Add fetch messages implementation on any kind of chat. It's behind a
   toggle (on by default) as design is still unsure whether we want it,
   but it's very useful for debugging.
2) Allow setting light client from mobile

It also partially remove node config management from the clojure part,
as it's better if that's not explicitly managed by clients.
Some parts are still relying on it but they are not functional
(keycard), while others are still using it and will need to be updated
eventually (syncing), in order to get rid completely of node config.

status-im/status-go@8a4c2d8...5de4057
@VolodLytvynenko
Copy link
Contributor

Hi @cammellos could you please resolve conflicts in the current PR? Thanx!

@cammellos
Copy link
Contributor Author

@VolodLytvynenko I believe this has been merged alreayd in a different PR, I will close it, thank you

@cammellos cammellos closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants