-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: v1 wip #141
feat: v1 wip #141
Conversation
b7c3d21
to
cc837ff
Compare
|
||
info!("Response: {response:?} for /v1/notify from project: {project_id}"); | ||
|
||
if let Some(metrics) = &state.metrics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will probably remove these metrics in a follow-up PR, as these have been replaced with other ones.
@@ -468,7 +597,7 @@ pub async fn get_subscription_watchers_for_account_by_app_or_all_app( | |||
SELECT project, did_key, sym_key | |||
FROM subscription_watcher | |||
LEFT JOIN project ON project.id=subscription_watcher.project | |||
WHERE account=$1 AND (project IS NULL OR project.app_domain=$2) | |||
WHERE expiry > now() AND account=$1 AND (project IS NULL OR project.app_domain=$2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixed query returning to expired watchers, not a major issue, but a fix nevertheless
&self.wsclient, | ||
&self.state.metrics, | ||
) | ||
async fn connect(state: &AppState, client: &Client) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary wrapper struct. Refactored to simplify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see anything obviously wrong, but it's almost impossible to review this, it's just too big. Each of the items in the least could have been a single PR.
@@ -30,7 +30,7 @@ pub struct SubscriberNotification { | |||
/// Hash of the CAIP-10 account of the subscriber | |||
pub account_hash: String, | |||
/// The notification type ID | |||
pub notification_type: Arc<str>, | |||
pub notification_type: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change to String
, is it because of the DB mapping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the notification type was changed from Arc<str>
to a Uuid
in most of the codebase. And here it's creating a new String
representation for it via .to_string()
and converting the String
to an Arc<str>
doesn't provide any value
…into chore/messaging-refactor
…into chore/messaging-refactor
Description
Implements WalletConnect/walletconnect-specs#161
Resolves #70
Resolves #39
Changes
Queuing functionality:
Relay:
/v1/subscribers
Metrics:
@chris13524 Grafana panel for showing status codes somehowRefactors:
Tasks
Microservice:
To process notifications async from the API server we've decided to go with the separate microservice that processes messages from the queue:
Deploying mechanism updates for the new microservice.Deferred:
How Has This Been Tested?
Test cases
Due Diligence