Skip to content

Conversation

@OrMemphis
Copy link
Contributor

No description provided.

// NATS SDK, means we extract username from the token field
splittedToken := strings.Split(client.opts.Token, connectItemSep)
if len(splittedToken) != 2 {
client.Warnf("handleConnectMessage: missing username or connectionId")
Copy link
Contributor

Choose a reason for hiding this comment

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

connection id -> token

splittedToken := strings.Split(client.opts.Token, connectItemSep)
if len(splittedToken) != 2 {
client.Warnf("handleConnectMessage: missing username or connectionId")
return errors.New("missing username or connectionId")
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

}
username := splittedToken[0]
client.memphisInfo = memphisClientInfo{username: username, isNative: false}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

this function should validate the user validations part + send proper analytics (new event user-connect-nats-sdk)

func (js *jetStream) apiDispatch(sub *subscription, c *client, acc *Account, subject, reply string, rmsg []byte) {
// No lock needed, those are immutable.
s, rr := js.srv, js.apiSubs.Match(subject)
wrappedSubject := memphisFindJSAPIWrapperSubject(c, subject)
Copy link
Contributor

Choose a reason for hiding this comment

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

I need you to explain it to me


msgs, err := s.memphisGetMsgs(stationName.Intern()+".final",
stationName.Intern(),
msgs, err := s.memphisGetMsgs(stationName.Intern(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have you deleted it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently, there was no use of that parameter inside the function, just cleaned it.

@@ -1,7 +1,7 @@
{
"files": {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove all static files from the PR

@OrMemphis OrMemphis force-pushed the nats-sdk-compatiblity branch from 83c232d to 762585d Compare December 19, 2022 13:48
@OrMemphis OrMemphis changed the base branch from master to master-temp December 20, 2022 09:29
removeFunc := nonNativeRemoveStreamFunc
if removeFunc == nil {
if !station.IsNative {
s.Fatalf("non native station uses native remove stream function")
Copy link
Contributor

Choose a reason for hiding this comment

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

please change to error and return the user an error

}
analyticsParams := []analytics.EventParam{param}
analytics.SendEventWithParams(user.Username, analyticsParams, "user-connect-sdk")
analytics.SendEventWithParams(username, analyticsParams, "user-connect-sdk")
Copy link
Contributor

Choose a reason for hiding this comment

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

please send new event user-connect-nats-sdk when this is non native connection

@OrMemphis OrMemphis merged commit d027af4 into master-temp Dec 21, 2022
@idanasulin2706 idanasulin2706 deleted the nats-sdk-compatiblity branch January 30, 2023 15:28
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