Skip to content

Feature pn price change#602

Merged
ice-ares merged 8 commits into
masterfrom
feature_pn_price_change
Mar 13, 2026
Merged

Feature pn price change#602
ice-ares merged 8 commits into
masterfrom
feature_pn_price_change

Conversation

@ice-dionysos

Copy link
Copy Markdown
Contributor

No description provided.

@ice-dionysos ice-dionysos self-assigned this Mar 10, 2026
Copilot AI review requested due to automatic review settings March 10, 2026 08:00
@ice-dionysos ice-dionysos requested a review from a team as a code owner March 10, 2026 08:00
Comment thread database/query/query_pn_price.go Fixed
Comment thread database/query/query_pn_price.go Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread database/query/ddl/00022_pn_price.sql Outdated
Comment thread push-notifications/pushnotifications.go Outdated
Comment thread push-notifications/devices.go
Comment thread validation/validate.go Outdated
Comment thread push-notifications/pushnotifications_queue.go Outdated
Comment thread push-notifications/pushnotifications.go Outdated
Comment thread push-notifications/pushnotifications.go
Comment thread push-notifications/devices.go
Comment thread validation/validate.go
Comment thread push-notifications/pushnotifications.go Outdated
Comment thread validation/validate.go Outdated
Comment thread database/query/ddl/00022_pn_price.sql
Comment thread database/query/ddl/00022_pn_price.sql

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 push broadcast listener calls webserver.BroadcastNewEvents(ctx, ...) using the incoming context. In this file, other broadcast paths use context.WithoutCancel(ctx) to ensure broadcasting completes even if the upstream context is cancelled (see earlier BroadcastUserEvents / BroadcastNewEvents submits). Consider using context.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.

Comment thread push-notifications/devices.go Outdated
Comment thread push-notifications/devices_test.go
Comment thread database/query/query_pn_price.go
Comment thread dvm/dvm.go
Comment thread dvm/dvm.go
Comment thread dvm/dvm.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread push-notifications/notification_dvm.go
Comment thread push-notifications/devices.go
Comment thread validation/validate.go
@ice-ares ice-ares merged commit 5b93591 into master Mar 13, 2026
61 of 63 checks passed
@ice-ares ice-ares deleted the feature_pn_price_change branch March 13, 2026 08:27
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