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

Track message sequences for Waku dogfooding #20

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

adklempner
Copy link
Collaborator

@adklempner adklempner commented Jun 5, 2024

Adds a table and endpoint for tracking Waku data for the dogfooding app

This shouldn't effect any status-related telemetry

@adklempner adklempner force-pushed the feat/waku-message-sequence branch 2 times, most recently from 99ce071 to 9bf0463 Compare June 5, 2024 05:06
@adklempner adklempner marked this pull request as ready for review June 5, 2024 05:06
@adklempner adklempner marked this pull request as draft June 5, 2024 05:09
@adklempner adklempner force-pushed the feat/waku-message-sequence branch 3 times, most recently from d26f2a1 to e66f3de Compare June 24, 2024 02:41
@adklempner adklempner marked this pull request as ready for review June 24, 2024 02:49
id SERIAL PRIMARY KEY,
walletAddress VARCHAR(255),
peerIdSender VARCHAR(255) NOT NULL,
peerIdReporter VARCHAR(255) NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

what is reporter in this context? is it the node that we sent message to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reporter is the node being run by the same user who sends this data to telemetry. When sending a message via lightpush, reporter and sender will be the same.


type TelemetryPushFilter struct {
ID int `json:"id"`
WalletAddress string `json:"walletAddress"`
Copy link
Contributor

Choose a reason for hiding this comment

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

seems we don't need it for dogfooding

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's an optional field in the db table

@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS errorSendingEnvelope (
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this table? it doesn't seem needed for dogfooding and maybe can be combined with other envelope tables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed as it will be handled in separate PR after this one

@@ -349,7 +358,65 @@ func (s *Server) rateLimit(next http.Handler) http.Handler {
})
}

func (s *Server) createWakuTelemetry(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how it sounds :D

@adklempner adklempner force-pushed the feat/waku-message-sequence branch 3 times, most recently from 2aba797 to f9fef72 Compare June 24, 2024 23:39
Copy link
Contributor

@weboko weboko left a comment

Choose a reason for hiding this comment

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

great! let's iterate in following PRs

if err != nil {
return err
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
defer stmt.Close()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

return
}

var errorDetails []map[string]interface{}
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to create a type instead?

type ErrorDetail struct {
  Id string `json:"Id"`
  Error string `json:"Error"`
}

And then use that type in

var errorDetails []map[string]ErrorDetail

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added and included in http response when errors are encountered

@adklempner adklempner merged commit 1dc5ce5 into status-im:master Jun 25, 2024
1 check passed
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.

3 participants