Skip to content

Merge dev: Logging system, Alliance Partner support, server fixes#47

Merged
zortos293 merged 18 commits intomainfrom
dev
Dec 27, 2025
Merged

Merge dev: Logging system, Alliance Partner support, server fixes#47
zortos293 merged 18 commits intomainfrom
dev

Conversation

@zortos293
Copy link
Collaborator

Summary

  • Add comprehensive logging system with export functionality
  • Add Alliance Partner (GFN.AM, etc.) support
  • Fix server discovery for NVIDIA servers
  • Update bug report template to require logs

Logging System

  • Custom FileLogger writes to %APPDATA%/opennow/opennow.log
  • Auto-clears when exceeding 10MB
  • Privacy-safe export: Sanitizes tokens, emails, IPs before export
  • Frontend logging intercepts console.* and sends to backend
  • Export/Clear buttons in Settings > Troubleshooting

Alliance Partner Support

  • Provider field persisted in AuthState
  • Streaming endpoints use partner URLs when applicable
  • Skip PrintedWaste queue for partners

Server Discovery Fix

  • Fetches server info from /v2/serverInfo endpoint
  • Extracts correct server ID from URL subdomain
  • Fixes game launch failures on NVIDIA servers

Documentation

  • README: Added Troubleshooting section
  • Bug report template: Logs now required with export instructions

zortos293 and others added 17 commits December 26, 2025 16:33
- auth.rs: Remove generate_state, extract_auth_code, TOKEN_CAPTURE_HTML, get_user_info
- streaming.rs: Remove SignalingMessage, DEFAULT_ICE_SERVERS, StreamingEvent
- proxy.rs: Remove should_bypass_proxy
- api.rs: Remove unused GraphQL queries, mutations, constants and build_image_url
…me_settings to true

Co-authored-by: zortos293 <65777760+zortos293@users.noreply.github.com>
Co-authored-by: zortos293 <65777760+zortos293@users.noreply.github.com>
- Replace vite with rolldown-vite for faster Rust-based bundling
- Switch from npm to bun across all configs and CI
- Update GitHub Actions to use oven-sh/setup-bun@v2
- Add esbuild as peer dependency (required by rolldown-vite)
- Update all dependencies to latest versions
- Update README and CONTRIBUTING docs
- Fix session polling timeout for free tier users in queue
  - Remove timeout when user is in queue (status 1 with queue_position > 0)
  - Add adaptive polling intervals (5s deep in queue, 3s near front)
  - Add get_queue_status command for frontend to query queue state

- Add queue position display in streaming overlay
  - Show prominent queue position number while waiting
  - Display helpful hint about free tier wait times
  - Auto-hide queue info when session becomes ready

- Restrict streaming options for free tier users
  - Limit resolutions to 1080p and below (any aspect ratio)
  - Limit FPS to 120 and below (no 240/360 FPS)
  - Auto-select appropriate defaults when filtered
feat: add queue times navigation and API integration for free tier users
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
chore: migrate from npm/vite to bun/rolldown-vite
- Updated fetchServerMapping and fetchQueueData functions to use tauriFetch from the @tauri-apps/plugin-http for improved compatibility with Tauri environment.
…erver fixes

## Logging System (New Feature)

### Backend (src-tauri/src/logging.rs)
- Created custom FileLogger that writes to both console and file
- Log file location: %APPDATA%/opennow/opennow.log (Windows)
- Auto-clears logs when file exceeds 10MB (with marker message)
- Session start markers for easy debugging

### Log Sanitization for Privacy
- Redacts JWT tokens (eyJ... format)
- Redacts Bearer tokens
- Redacts JSON token fields (access_token, refresh_token, etc.)
- Redacts email addresses
- Redacts long hex strings (32+ chars)
- Redacts base64-like tokens (40+ chars)
- Anonymizes IP addresses (last octet replaced with xxx)
- Adds privacy header to exported logs

### Frontend Logging (src/logging.ts)
- Intercepts console.log/warn/error/info/debug
- Sends all frontend logs to backend for unified logging
- Captures unhandled errors and promise rejections

### New Tauri Commands
- log_frontend: Receive logs from JavaScript
- get_log_file_path: Get current log file path
- export_logs: Export sanitized logs via save dialog
- clear_logs: Manually clear log file

### UI Changes (index.html, main.css)
- Added 'Export Logs' button in Settings modal
- Added 'Clear Logs' button next to export
- New Troubleshooting section with hint text
- Side-by-side button layout

## Alliance Partner Support

### Authentication (src-tauri/src/auth.rs)
- Added provider field to AuthState for persistence
- login_oauth and login_with_token save provider with auth
- get_auth_status restores provider from saved auth
- Support for GFN Alliance Partners (GFN.AM, etc.)

### Frontend (src/main.ts)
- isAlliancePartner() helper function
- AuthState interface with provider field
- checkAuthStatus() restores provider on startup
- Skip PrintedWaste queue for Alliance Partners

### Streaming (src-tauri/src/streaming.rs)
- start_session uses Alliance Partner URLs when applicable
- poll_session_until_ready supports partner endpoints
- stop_session works with partner sessions

## Server Discovery Fix

### Dynamic Server Info (src-tauri/src/api.rs)
- get_servers() now fetches from /v2/serverInfo endpoint
- Extracts server ID from URL subdomain (e.g., eu-netherlands-south)
- Fixed session URL construction for NVIDIA servers
- Previously used display name which caused launch failures

### Before: netherlands-south (wrong - from display name)
### After: eu-netherlands-south (correct - from URL subdomain)

## Documentation Updates

### README.md
- Added Troubleshooting section with log export instructions
- Log file locations for Windows, macOS, Linux
- Link to bug report template

### .github/ISSUE_TEMPLATE/bug_report.yml
- Made logs a required field
- Added step-by-step export instructions
- Separate optional screenshots field

### AGENTS.md (New)
- AI agent guidelines for the codebase
- Build commands and code style guidelines
- Project structure documentation

## Other Changes

### Dependencies (Cargo.toml)
- Added regex-lite for log sanitization

### Rust 2024 Compatibility (cursor.rs)
- Fixed extern block to use 'unsafe extern' syntax

### Version bump to 0.0.18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a comprehensive logging system, adds support for Alliance Partners (regional GeForce NOW providers like GFN.AM), and fixes server discovery issues for NVIDIA servers. The changes include frontend and backend logging infrastructure, multi-region authentication support, and improved queue handling for free-tier users.

Key Changes

  • Logging System: Implements a complete logging infrastructure with automatic log rotation at 10MB, privacy-safe export with token/email sanitization, and frontend console interception
  • Alliance Partner Support: Adds multi-region login provider selection, dynamic server discovery via /v2/serverInfo endpoint, and provider-specific streaming URL handling
  • Queue Management: Integrates PrintedWaste API for queue time visibility, adds server selection modal for free-tier users, and implements smart auto-selection based on ping and wait times

Reviewed changes

Copilot reviewed 21 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/logging.ts New frontend logging module that intercepts console methods and sends logs to backend
src-tauri/src/logging.rs Backend logging implementation with file rotation, sanitization, and export functionality
src-tauri/src/auth.rs Multi-region authentication with login provider management and persistence
src-tauri/src/api.rs Dynamic server discovery with VPC ID extraction and region mapping
src-tauri/src/streaming.rs Alliance Partner streaming support, queue status polling, and indefinite queue waiting
src/main.ts Queue selection UI, provider dropdown, troubleshooting buttons, and extensive queue management logic
src/styles/main.css Styles for troubleshooting section, login provider dropdown, and queue selection modal
index.html UI additions for region/provider selection and troubleshooting section
package.json Version bump to 0.0.18 and migration to Bun with updated Tauri dependencies
src-tauri/Cargo.toml Version bump and addition of regex-lite dependency
src-tauri/tauri.conf.json Version update and build command migration to Bun
src-tauri/capabilities/default.json HTTP permissions for PrintedWaste API endpoints
README.md New troubleshooting section with log export instructions
.github/ISSUE_TEMPLATE/bug_report.yml Logs now required for bug reports with export instructions
.github/workflows/auto-build.yml CI migration from npm to Bun
.github/CONTRIBUTING.md Updated prerequisites to require Bun
src-tauri/src/cursor.rs Fixed unsafe extern declaration syntax
src-tauri/src/proxy.rs Removed unused should_bypass_proxy function
src-tauri/src/native/gui.rs Enabled persistent in-game settings
src-tauri/src/lib.rs Registered new logging and provider management commands
.gitignore Updated to keep bun.lock and exclude package-lock.json

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zortos293 zortos293 merged commit f57870c into main Dec 27, 2025
zortos293 added a commit that referenced this pull request Feb 21, 2026
Merge dev: Logging system, Alliance Partner support, server fixes
zortos293 added a commit that referenced this pull request Feb 21, 2026
Merge dev: Logging system, Alliance Partner support, server fixes
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.

"Failed to launch game: Session polling timeout - server not ready" region not supported Queue/Info

5 participants