Skip to content

Fix undefined variable in PubSub module#13

Merged
timujinne merged 7 commits intomasterfrom
claude/fix-pubsub-symbol-error-01JXRNWnsWkCECGzVhE1p8WW
Nov 14, 2025
Merged

Fix undefined variable in PubSub module#13
timujinne merged 7 commits intomasterfrom
claude/fix-pubsub-symbol-error-01JXRNWnsWkCECGzVhE1p8WW

Conversation

@timujinne
Copy link
Owner

No description provided.

Fixed undefined variable error in SharedData.PubSub moduledoc by properly
escaping the #{symbol} placeholder with double backslash. This prevents
Elixir from attempting to interpolate 'symbol' as a variable at compile time.
Changed @moduledoc from regular triple-quote string to ~S sigil string
to properly disable string interpolation. This allows #{symbol} to be
displayed literally in the documentation without compilation errors.
Added phoenix_pubsub ~> 2.1 to shared_data dependencies to resolve
compilation warnings about undefined Phoenix.PubSub module when
using --warnings-as-errors flag.
- Move Phoenix.PubSub to start first in DataCollector.Application supervision tree
  to prevent "unknown registry" error when MarketData tries to subscribe
- Replace non-existent :binance_system app config with :shared_data
- Add ecto_repos config to all umbrella apps to fix Ecto warnings
- Update dashboard_web to use BinanceSystem.PubSub instead of DashboardWeb.PubSub

This ensures PubSub is available before any child processes attempt to use it.
Modified trades table to use composite primary key (id, timestamp) as
required by TimescaleDB when creating hypertables with timestamp partitioning.

Changes:
- Migration: Create unique index on (id, timestamp) as primary key
- Schema: Update Trade schema to use composite primary key
- This allows create_hypertable to succeed with timestamp partitioning

TimescaleDB requires partitioning columns to be part of unique indexes.
Changed from unique_index with primary: true (not supported) to direct
SQL ALTER TABLE command to create composite primary key (id, timestamp).
This is required for TimescaleDB hypertable partitioning.
TimescaleDB continuous aggregates cannot be created WITH DATA inside
a transaction. Adding WITH NO DATA allows the view to be created within
the migration transaction. Data will be populated automatically by the
continuous aggregate refresh policy.
@timujinne timujinne merged commit 4a2e7e1 into master Nov 14, 2025
4 checks passed
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.

2 participants