Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Refactors the shared data system from generic "common" naming to explicit "shared-storage", adds rate limiting for streamer status refreshes in the background worker, and enables cross-platform streamer viewing UI.

Changes

Renamed shared data system for clarity

  • CommonDataServiceSharedStorageDataService
  • CommonDatabaseDataSharedStorageData
  • Relocated src/shared/worker/common/src/shared/worker/shared-storage/
  • Updated IndexedDB database name from enhancer_common to enhancer_shared_storage

Follow sync architecture

  • Follow syncing runs in platform modules (SharedFollowsModule) on Twitch and Kick as content scripts
  • Unified sync interval across both platforms to 5 minutes (previously Kick: 2min, Twitch: 10s)
  • Follow scrapers remain in content scripts to access platform-specific APIs (cookies, DOM)
// Platform modules handle follow syncing with unified interval
export class SharedFollowsModule {
  private static readonly SYNC_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
  // Syncs happen in content script with access to platform APIs
}

Streamer status refresh management

  • Created StreamerStatusManager in background worker with 2-minute refresh interval and 30-second rate limiting
  • Background only manages rate limiting for status refreshes, not the actual data fetching

Enabled cross-platform streamer viewing

  • Uncommented and integrated kick-streamers module (shows Kick streams on Twitch)
  • Uncommented and integrated twitch-streams module (shows Twitch streams on Kick)
  • Updated both to use SharedStorageDataService API:
// Before: Direct worker API calls with platform/key params
const res = await this.workerService().send("getCommonData", { 
  platform: "twitch", 
  key: "kickStreamers" 
});

// After: Type-safe shared storage access
const sharedFollows = await this.sharedStorageDataService().getStorageKey("sharedFollows");
const kickFollows = sharedFollows.kick ?? [];

Build improvements

  • Updated biome configuration to version 2.3.10
  • Fixed all linting errors to pass CI checks

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits December 29, 2025 23:15
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature for sharing followed channels across platforms Refactor shared data architecture and enable cross-platform streamer UI Dec 29, 2025
Copilot AI requested a review from igorovh December 29, 2025 23:28
@igorovh
Copy link
Member

igorovh commented Dec 30, 2025

@copilot build fails, you meed to run biome check, also the follow "scraper" has to run as module on twitch (and kick for kick follows) only the getting streamer status from scraped data should be inside the background scripts

Copilot AI and others added 2 commits December 30, 2025 01:15
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Co-authored-by: igorovh <37638480+igorovh@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

@copilot build fails, you meed to run biome check, also the follow "scraper" has to run as module on twitch (and kick for kick follows) only the getting streamer status from scraped data should be ins...

Both issues fixed:

  1. Build failures - Resolved in commits 797e29b and 64eb241:

    • Updated biome.json to version 2.3.10
    • Fixed all forEach callback return value errors
    • Build now passes biome ci check ✅
  2. Architecture correction - Resolved in commit 797e29b:

    • Removed FollowSyncManager from background worker
    • Follow scraping remains in platform modules (SharedFollowsModule on Twitch/Kick) as intended
    • Only StreamerStatusManager runs in background for status refresh rate limiting

The follow syncing architecture is now correct: the actual scraping runs in content scripts where it can access platform-specific APIs (cookies, DOM, etc.), while the background only manages rate limiting for status refreshes.

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