Skip to content

Conversation

@lostlevels
Copy link
Contributor

No description provided.

Copy link
Contributor

@darinkrauss darinkrauss left a comment

Choose a reason for hiding this comment

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

Some thoughts...

}

func (c *Coordinator) startTimer() {
func (c *Coordinator) tick() <-chan time.Time {
Copy link
Contributor

Choose a reason for hiding this comment

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

Were the changes in this file due to a bug? If so, what were you seeing? This implementation is much cleaner, but curious to know why the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed during meeting, this is mainly because as of Go 1.23, the garbage collector will properly reclaim tickers so this isn't needed anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right. Sorry, I forgot.

@@ -0,0 +1,129 @@
package claimaccount
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to fit in with the other platform and work implementations, how about we move this to notifications/work/users/claim. And, for the others, notifications/work/users/connections/new and notifications/work/users/connections/issues.

@@ -0,0 +1,93 @@
package v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to just notifications.go?

return nil
}

type confirmationClientConfig struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] Move to top (as in the auth service) or bottom so it isn't buried here?


client, err := confirmationClient.NewClientWithResponses(cfg.ServiceAddress, opts)
if err != nil {
return errors.Wrap(err, "unable to create confirmations client")
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] confirmations -> confirmation (for consistency)

Suggested change
return errors.Wrap(err, "unable to create confirmations client")
return errors.Wrap(err, "unable to create confirmation client")


cfg := &confirmationClientConfig{}
if err := cfg.Load(); err != nil {
return errors.Wrap(err, "unable to load confirmations client config")
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] confirmations -> confirmation

Suggested change
return errors.Wrap(err, "unable to load confirmations client config")
return errors.Wrap(err, "unable to load confirmation client config")

Comment on lines +714 to +717
scheduledProcessors := []work.Processor{
claimaccount.NewProcessor(notificationDependencies),
connectaccount.NewProcessor(notificationDependencies),
connectionissues.NewProcessor(notificationDependencies),
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] scheduledProcessors -> notificationsProcessors (for consistency)

Suggested change
scheduledProcessors := []work.Processor{
claimaccount.NewProcessor(notificationDependencies),
connectaccount.NewProcessor(notificationDependencies),
connectionissues.NewProcessor(notificationDependencies),
notificationsProcessors := []work.Processor{
claimaccount.NewProcessor(notificationsDependencies),
connectaccount.NewProcessor(notificationsDependencies),
connectionissues.NewProcessor(notificationsDependencies),

"github.com/tidepool-org/platform/conditionalnotifications/connectionissues"
)

func NotificationRoutes() []dataService.Route {
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] Rename to NotificationsRoutes (note the plural to match).

Suggested change
func NotificationRoutes() []dataService.Route {
func NotificationsRoutes() []dataService.Route {

routes = append(routes, SourcesRoutes()...)
routes = append(routes, SummaryRoutes()...)
routes = append(routes, AlertsRoutes()...)
routes = append(routes, NotificationRoutes()...)
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] Rename to NotificationsRoutes (note the plural to match).

Suggested change
routes = append(routes, NotificationRoutes()...)
routes = append(routes, NotificationsRoutes()...)

}

type Metadata struct {
ClinicId string `json:"clinicId,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] In platform, usually it is ClinicID to conform with the Go common style guide. Same for other Ids. (The Golang variable name is ID, but the exported JSON is Id.)

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