Feature pn price change#602
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for tokenized-community token price-change push notifications by introducing a new DVM job kind, persistence for subscriptions/rate-limiting, and a dedicated push-notification queue worker.
Changes:
- Introduces new custom kinds for price-change DVM job request/response and validates request parameters.
- Adds DB schema + query layer for registering subscribers, selecting candidates, and generating notifications with rate limiting.
- Adds a push-notifications queue worker and integrates scheduling/processing into the push notification manager; updates device-cache management and tests to use context-aware APIs.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
validation/validate.go |
Adds kind validator for price-change DVM job request parameters (param tags). |
model/model.go |
Adds custom kind constants for price-change DVM request/response. |
database/query/ddl/00022_pn_price.sql |
Adds pn_price_changes table and SQL functions for candidate selection + batch notify/update. |
database/query/query_pn_price.go |
Implements DB client methods for subscription registration, candidate collection, and notification fetch/update. |
database/query/query_pn_price_test.go |
Adds tests covering subscription registration and notification triggering/rate-limiting behavior. |
database/query/global.go |
Exposes global wrappers for the new price-change query functions. |
database/query/client.go |
Extends DB field-name mapping to support new query result structs (pnFieldMap). |
push-notifications/pushnotifications.go |
Adds notification type + translations, registers the new worker, and schedules TC price-change processing. |
push-notifications/pushnotifications_queue.go |
New rq worker to build and send price-change push notifications. |
push-notifications/devices.go |
Makes device registration/cache removal context-aware and ties device registration filters to price-change subscription registration/cleanup. |
push-notifications/*_test.go |
Updates tests/benchmarks for new processDeviceRegistrationEvent(ctx, ...) signature. |
event-matcher/storage.go / event-matcher/matcher.go / event-matcher/event_matcher_test.go |
Changes RemoveByHash to return removed value + success flag and updates tests/callers. |
go.mod / go.sum |
Bumps several dependencies and adds shopspring/decimal for price parsing/comparison. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
590aba0 to
7396e0e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
cmd/subzero-ion-connect/subzero_ion_connect.go:240
- The
pushbroadcast listener callswebserver.BroadcastNewEvents(ctx, ...)using the incoming context. In this file, other broadcast paths usecontext.WithoutCancel(ctx)to ensure broadcasting completes even if the upstream context is cancelled (see earlierBroadcastUserEvents/BroadcastNewEventssubmits). Consider usingcontext.WithoutCancel(ctx)here as well to avoid dropping broadcasts when the DVM/RQ context is cancelled/timeouts.
push := func(ctx context.Context, events ...*model.Event) error {
antsPool.Submit(func() {
start := time.Now()
n := webserver.BroadcastNewEvents(ctx, events...)
end := time.Since(start)
log.Trace().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.