Implements comprehensive callsign search and live tracking:
- search_callsign: Search for callsigns with wildcard support
- "W5ISP" finds W5ISP and all SSIDs (W5ISP-1, W5ISP-9, etc.)
- "W5ISP-9" finds only that specific SSID
- "W5ISP*" finds all callsigns starting with W5ISP
- subscribe_callsign: Subscribe to live updates for a callsign
- Loads historical packets for the callsign
- Receives real-time streaming updates
- Supports wildcard patterns
- Works with or without geographic bounds
- unsubscribe_callsign: Stop tracking callsign
When both bounds and callsign are subscribed, packets are filtered
by both criteria (callsign AND within bounds).
Generated with Claude Code https://claude.com/claude-code
Replace 'with' clause that was failing when socket.assigns[:subscribed]
returned nil. Now properly checks subscription status using Map.get with
a default value of false to prevent WithClauseError.
Fixes error: no with clause matching: nil
Generated with Claude Code https://claude.com/claude-code
When mobile clients subscribe to bounds, the server now loads and sends
historical packets immediately, followed by real-time streaming packets.
This matches the web UI behavior and provides a complete view of APRS
activity in the requested area.
Optional parameters:
- limit: Max historical packets to load (default: 1000, max: 5000)
- hours_back: Hours of historical data (default: 1, max: 24)
Generated with Claude Code https://claude.com/claude-code
- Create MobileChannel for geographic bounds-based packet filtering
- Add MobileUserSocket for mobile client connections
- Implement subscribe_bounds, update_bounds, and unsubscribe events
- Leverage existing StreamingPacketsPubSub infrastructure
- Add comprehensive mobile API documentation with Swift examples
- WebSocket endpoint: wss://aprs.me/mobile/websocket
- Channel: mobile:packets
This enables iOS/Android apps to receive real-time APRS packets
filtered by geographic viewport, with efficient bandwidth usage.
- Set websocket timeout to 60000ms in endpoint configuration
- Add timeout option to LiveSocket client configuration
- Fixes timeout errors during initial map load with large packet count
- Always use ETS-based RateLimiter instead of checking for REDIS_URL
- Remove RedisRateLimiter calls that were causing crashes
- Simplify wrapper to only delegate to Aprsme.RateLimiter
- Replace Cachex with native ETS (Erlang Term Storage) in Cache module
- Remove Redis-based caching logic from application.ex
- Always initialize ETS tables for device_cache, query_cache, symbol_cache
- Update StatusLive to use Aprsme.Cache instead of Cachex directly
- Fix crash on startup when REDIS_URL was set but Redis not used
This fixes the no_cache error that was causing pods to crash.
Previously, when clustering was enabled, the leader election process
would wait indefinitely for the cluster to form. If cluster formation
failed or took too long, no leader would be elected and the APRS-IS
connection would never start, leaving the system disconnected.
Changes:
- Add 30-second timeout for cluster formation
- Force leader election after timeout, even in single-node mode
- Add election_forced flag to prevent duplicate election attempts
- Improve logging to distinguish between cluster and single-node modes
This ensures that at least one node will always connect to APRS-IS,
even if clustering fails completely.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove Exq dependency from mix.exs and application config
- Remove all Exq configuration from config files (config.exs, dev.exs, runtime.exs, test.exs)
- Update CleanupScheduler to run cleanup tasks directly using Task.start instead of queuing jobs
- Update PacketCleanupWorker documentation to remove Exq references
- Cleanup functionality preserved but now runs in supervised Tasks instead of job queue
This resolves the Redis connection error on startup by eliminating the dependency on external job queues.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove phoenix_pubsub_redis dependency from mix.exs
- Update PubSub configuration to use Phoenix's native distributed capabilities
- Simplify clustering logic - no longer requires Redis URL for PubSub
- Phoenix PubSub automatically distributes messages across connected Erlang nodes
- Benefits: lower latency, automatic failure handling, simpler deployment
- Redis still available for caching and job processing when needed
- Maintains backward compatibility for both clustered and non-clustered modes
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix duplicate bad packet storage in store_packet function
- Changed insert_packet to return specific error tuples
- Handle validation_error and storage_exception separately
- Prevent double storage of bad packets
- Add try/catch wrapper around insert_packet for exception handling
- Properly catch and return storage_exception errors
- Test now correctly expects :storage_exception
- Add helper function for LiveView tests with duplicate IDs
- Added live_with_warn/2 to ConnCase
- Suppress duplicate ID warnings in integration tests
- Fix unused variable warning in insert_packet
All packet tests now pass without failures.
- Remove duplicate time formatting function in components.ex
- Use existing time_ago_in_words from TimeHelpers instead of custom format_time_ago
- Remove unnecessary Float multiplication in format_coordinates
- Changed Float.round(lat * 1.0, 4) to Float.round(lat, 4)
- Fix TypeScript type safety issues
- Add pendingMarkers to LiveViewHookContext interface
- Add initializationTimeout property for proper cleanup
- Add cleanup for map initialization retry timeout
- Prevent memory leak by clearing timeout in destroyed() method
- Format code with mix format
All changes maintain backward compatibility while improving code quality.
The phx-update="stream" directive requires all direct children to have IDs.
Removed the conditional empty state message that was causing client-side errors.
Fixed incorrect class attribute syntax that was using tuple notation instead of proper conditional class lists. This was causing Protocol.UndefinedError for String.Chars.
The recent refactor removed loading and connection_status assigns which were required by the slideover_panel component, causing the app to crash on startup. This adds back the missing assigns with default values.
Previously, packets sent via APRS-IS (Internet) would incorrectly show
RF path lines to the uploader's callsign. This fix filters out paths
containing TCPIP, NOGATE, or qA* indicators, which indicate Internet-only
transmission rather than actual RF digipeating.
For example, AE5PL-S packets posted by AE5PL via Internet will no longer
show a misleading RF path line between them.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
For stations that send both position and status packets, the info page would show empty location data if the most recent packet was a status packet. This fix ensures the page displays the last known position from the most recent position packet while still showing the latest activity timestamp.
Add posresolution and rain_midnight to the list of float fields in
normalize_numeric_types to ensure integer values are converted to floats
before database insertion. This fixes the Ecto.ChangeError that was
preventing many APRS packets from being stored in the database.
- Combine Chart.js and date adapter into single bundle to ensure proper loading order
- Add validation to skip chart rendering when insufficient weather data (< 2 points)
- Update vendor loader to not load date adapter separately
- Prevents date adapter errors when weather stations have limited data
- Create migration to change string fields from VARCHAR(255) to TEXT type
- Add PacketSanitizer module for UTF-8 safe string truncation
- Update PacketConsumer to sanitize data before database insertion
- Prevents database errors from overly long packet data fields
The APRS parser is sending timestamp as integer (Unix timestamp) but our
schema expects a string. This was causing Ecto.ChangeError in production
preventing packet insertion.
Convert integer timestamps to strings in the field conversion pipeline.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Instead of playing whack-a-mole with individual fields, this implements a
proper whitelist approach that only allows fields defined in the Packet schema.
- Created PacketFieldWhitelist module with all 78 valid packet fields
- Filters out ANY field not in the schema, preventing future errors
- Handles both atom and string keys
- Includes debug helpers to identify filtered fields
This definitively fixes packet insertion failures by ensuring only valid
database fields are passed to Repo.insert_all, regardless of what the
APRS parser sends.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The parser is sending fields with different names than our schema:
- aprs_messaging? (with question mark) -> convert to aprs_messaging
- raw_data -> remove (not in schema)
This should fix the remaining packet insertion failures in production.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added item_name, object_name fields to store names
- Added is_item, is_object boolean flags for filtering
- Added dao field to store DAO extension data for extra position precision
- Automatic detection during packet processing to populate these fields
- Added database indexes for efficient queries
- Now preserving itemname as item_name and dao data instead of discarding
This enables future features like:
- Showing/hiding items and objects separately from stations
- Querying for specific objects (events, repeaters, etc.)
- Using DAO data for high-precision applications
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Production logs showed additional fields causing insertion failures:
- dao: DAO extension data
- itemname: Item name field
- longitude/latitude: Parser uses these but our schema uses lon/lat
Added conversion step to map latitude->lat and longitude->lon before processing.
This ensures packets can be properly saved to the database.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The updated APRS parser (commit 69d0ab5) adds several fields that don't exist in our database schema:
- type, digipeaters, daodatumbyte, mbits, message (duplicate of message_text)
- phg (we store individual PHG fields), wx (weather object)
- resultcode, resultmsg, gpsfixstatus
Created a centralized helper function to remove all non-schema fields before database insertion.
Also enhanced error logging to capture sample packet data for easier debugging.
This fixes the production issue where packets were failing to save to the database.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The weather view was crashing with FunctionClauseError when comparing
string timestamps with DateTime structs. This happens when packets are
broadcast with string timestamps instead of DateTime objects.
Changes:
- Add cases to handle when one timestamp is a string and the other is DateTime
- Parse ISO8601 string timestamps before comparison
- Append 'Z' to timestamps that don't have timezone info
- Fallback safely when parsing fails
This prevents crashes when the weather view receives packets with
mixed timestamp formats from different parts of the system.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The weather view was crashing with KeyError when receiving packets with
string keys instead of atom keys. This was happening when packets were
broadcast from different parts of the system.
Changes:
- Updated should_update_weather? to handle both atom and string keys
- Added proper nil checking for received_at timestamps
- Handle string timestamp comparisons as well as DateTime comparisons
This prevents crashes when the weather view receives packets with
inconsistent key types from PubSub broadcasts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The weather view was crashing with CaseClauseError when receiving numeric
values (like 83.0) from the database instead of strings. Also improved
the UI to only show weather fields that have valid data.
Changes:
- Added support for numeric values in format_weather_value function
- Added has_weather_field? helper to check for valid weather data
- Updated template to conditionally display weather fields
- Fields with nil, "N/A", or empty values are now hidden
- Wind field shows direction and speed independently if available
This prevents crashes and provides a cleaner UI by only showing available
weather data instead of displaying N/A values.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The recent APRS parser update added a gpsfixstatus field that doesn't exist
in our database schema. This was causing all packet insertions to fail in
production with ArgumentError, preventing any packets from being stored and
making historical packet loading impossible.
Changes:
- Added explicit removal of :gpsfixstatus field in packet_consumer.ex
- Added both atom and string key deletion for safety
- Placed removal alongside other field removals like raw_weather_data
This fixes the critical production issue where no packets were being stored,
which prevented historical packet loading from working.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Optimized list concatenation in PacketConsumer from O(n) to O(1) by prepending events
- Refactored coordinate rounding to avoid recreating anonymous functions on each call
- Added database indexes for case-insensitive searches on upper(sender) and upper(base_callsign)
- Implemented RegexCache to avoid recompiling regex patterns for wildcard device matching
- Added compound index on upper(sender) with received_at for efficient sorted queries
These changes improve performance in hot paths:
- Packet batching is now more efficient with better list operations
- Coordinate processing avoids function allocation overhead
- Database queries using UPPER() now use functional indexes
- Device wildcard matching no longer recompiles regex on every lookup
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed issue where historical packets were only loaded when tracking a specific callsign
- Changed needs_initial_historical_load to always be true on mount
- Added comprehensive test suite for historical packet loading scenarios
- Tests verify loading with/without tracked callsign, custom time ranges, and zoom-based limits
- Ensures users see recent activity immediately when visiting the map
Also fixed JavaScript error about enabledFeatures being undefined - this was from a browser extension, not the application code.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added 20 new database fields for enhanced parser compatibility:
- Standard parser fields: srccallsign, dstcallsign, body, origpacket, header, alive, posambiguity, symboltable, symbolcode, messaging
- Radio range field: radiorange
- Additional weather fields: rain_midnight, has_weather
- Enhanced weather data extraction with dedicated wx field support
- Updated PHG parsing to handle both string format ("1060") and legacy map structure
- Added extraction functions for standard parser compatibility fields
- Created comprehensive test suite for enhanced parser functionality
- Updated APRS parser to latest version with improved field extraction
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit includes several critical fixes and optimizations:
## Production Buffer Overflow Fix
- Fixed telemetry_vals data type conversion from strings to integers
- Enhanced put_telemetry_fields() with robust type conversion logic
- Handles mixed data types (string, integer, float) gracefully
- Prevents PacketConsumer GenServer crashes that caused buffer overflow
- Processes telemetry from both data_extended and top-level attrs
## Test Suite Performance Optimization
- Improved test execution speed by 48% (43.2s → 24.1s)
- Increased parallelization: max_cases from 16 to 48
- Optimized database connections and reduced timeouts
- Tagged slow tests and exclude them by default for fast development
- Fixed device seeding to only run when needed
- Enhanced log capture for packet consumer tests
## Code Quality Improvements
- Fixed handle_info clause grouping in LeaderElection
- Ensures mix compile --warnings-as-errors passes
- Added comprehensive telemetry conversion tests
- Improved test reliability and reduced flakiness
## Infrastructure Updates
- Added migration init container to StatefulSet for automatic schema updates
- Disabled AUTO_MIGRATE in main container (handled by init container)
- Created .test-commands with helpful test aliases
This resolves production stability issues and significantly improves development workflow.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes compilation warning by moving the catch-all handle_info/2 clause
to be immediately after the specific handle_info/2 clauses.
In Elixir, all function clauses with the same name and arity must be
grouped together for pattern matching to work correctly.
This resolves the 'mix compile --warnings-as-errors' failure.