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

Small mailserver async fetching refactor #5420

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

vitvly
Copy link
Contributor

@vitvly vitvly commented Jun 25, 2024

Two small refactors extracted from #5292

@status-im-auto
Copy link
Member

status-im-auto commented Jun 25, 2024

Jenkins Builds

Click to see older builds (20)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 73d3690 #1 2024-06-25 09:29:06 ~4 min ios 📦zip
✔️ 73d3690 #1 2024-06-25 09:29:37 ~4 min linux 📦zip
✔️ 73d3690 #1 2024-06-25 09:30:46 ~5 min android 📦aar
✖️ 73d3690 #1 2024-06-25 09:34:08 ~9 min tests 📄log
✖️ 38a6bd0 #2 2024-06-25 12:27:46 ~1 min tests 📄log
✔️ 38a6bd0 #2 2024-06-25 12:28:03 ~1 min android 📦aar
✔️ 38a6bd0 #2 2024-06-25 12:28:42 ~2 min linux 📦zip
✔️ 38a6bd0 #2 2024-06-25 12:29:05 ~2 min ios 📦zip
✔️ ed34eec #3 2024-06-25 12:42:08 ~2 min linux 📦zip
✔️ ed34eec #3 2024-06-25 12:42:25 ~2 min ios 📦zip
✔️ ed34eec #3 2024-06-25 12:45:27 ~5 min android 📦aar
✔️ ed34eec #3 2024-06-25 13:22:08 ~42 min tests 📄log
✔️ e1e04e6 #4 2024-07-01 16:00:34 ~4 min ios 📦zip
✔️ e1e04e6 #4 2024-07-01 16:02:25 ~6 min linux 📦zip
✔️ e1e04e6 #4 2024-07-01 16:03:35 ~7 min android 📦aar
✔️ e1e04e6 #4 2024-07-01 16:42:43 ~46 min tests 📄log
✔️ 4b86906 #5 2024-07-03 09:35:15 ~4 min ios 📦zip
✔️ 4b86906 #5 2024-07-03 09:39:58 ~9 min android 📦aar
✔️ 4b86906 #5 2024-07-03 09:40:36 ~9 min linux 📦zip
✔️ 4b86906 #5 2024-07-03 10:22:22 ~51 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d5bd177 #1 2024-07-10 08:38:17 ~2 min tests-rpc 📄log
✔️ d5bd177 #6 2024-07-10 08:38:52 ~3 min ios 📦zip
✔️ d5bd177 #6 2024-07-10 08:39:35 ~3 min linux 📦zip
✔️ d5bd177 #6 2024-07-10 08:41:41 ~6 min android 📦aar
✖️ d5bd177 #6 2024-07-10 08:43:38 ~7 min tests 📄log
✖️ d5bd177 #7 2024-07-10 09:01:00 ~8 min tests 📄log
✖️ d5bd177 #8 2024-07-10 11:49:18 ~6 min tests 📄log
✔️ 3dc67e2 #2 2024-07-15 16:12:57 ~2 min tests-rpc 📄log
✔️ 3dc67e2 #7 2024-07-15 16:13:33 ~3 min ios 📦zip
✔️ 3dc67e2 #7 2024-07-15 16:14:17 ~3 min linux 📦zip
✔️ 3dc67e2 #7 2024-07-15 16:14:48 ~4 min android 📦aar
✔️ 3dc67e2 #9 2024-07-15 16:54:29 ~44 min tests 📄log

@vitvly vitvly force-pushed the chore/autorequest-messages branch from 38a6bd0 to ed34eec Compare June 25, 2024 12:39
@vitvly vitvly marked this pull request as ready for review June 25, 2024 13:28
@vitvly vitvly self-assigned this Jun 25, 2024
@@ -1503,18 +1503,14 @@ func (m *Messenger) watchConnectionChange() {
// Instead we will poll the connection status.
m.logger.Warn("using WakuV1, can't watch connection changes, this might be have side-effects")
go pollConnectionStatus()
return
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I actually think return is better comparing to else.
It's a check of err != nil, so returning makes sense there. If we will have to add more code with conditions after go subscribedConnectionStatus(subscription), the tabulation will grow to the right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, fixed.

m.logger.Error("could not perform mailserver request", zap.Error(err))
}
}()
m.asyncRequestAllHistoricMessages()
Copy link
Collaborator

Choose a reason for hiding this comment

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

asyncRequestAllHistoricMessages doesn't use performMailserverRequest.
Not sure if we want it, but noting the difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, this one i don't quite understand - asyncRequestAllHistoricMessages does invoke performMailserverRequest here

response, err := m.performMailserverRequest(ms, func(ms mailservers.Mailserver) (*MessengerResponse, error) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, I got confused
So we were calling performMailserverRequest -> RequestAllHistoricMessages -> performMailserverRequest 😵‍💫

I guess then it's ok now

m.logger.Error("could not perform mailserver request", zap.Error(err))
}
}()
m.asyncRequestAllHistoricMessages()
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, I got confused
So we were calling performMailserverRequest -> RequestAllHistoricMessages -> performMailserverRequest 😵‍💫

I guess then it's ok now

@vitvly vitvly force-pushed the chore/autorequest-messages branch 2 times, most recently from 4b86906 to d5bd177 Compare July 10, 2024 08:35
@vitvly vitvly force-pushed the chore/autorequest-messages branch from d5bd177 to 3dc67e2 Compare July 15, 2024 16:10
@vitvly vitvly merged commit 67364da into develop Jul 16, 2024
10 checks passed
@vitvly vitvly deleted the chore/autorequest-messages branch July 16, 2024 07:53
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.

4 participants