Skip to content

Support browser-local Instagram demos - #36

Merged
softmarshmallow merged 1 commit into
mainfrom
feature/browser-local-instagram-provider
Jul 23, 2026
Merged

Support browser-local Instagram demos#36
softmarshmallow merged 1 commit into
mainfrom
feature/browser-local-instagram-provider

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

Summary

  • add an explicit browser-local Instagram provider mode and automatic activation for immutable static Play exports
  • run the checked Instagram authority, supported mutations, uploads, and captured asset resolution inside the browser session
  • preserve the existing network-backed provider behavior for normal Editor and Play hosts
  • cover browser-local boot, mutation settlement, authority refresh, and asset resolution

Why

A static Uhura export has no Spock database process behind it. The Instagram example still needs a real provider authority for Play to operate, so exported demos use a deterministic in-session authority while live hosts continue to discover and use Spock normally.

Checks

  • corepack pnpm@10.11.0 -C web exec vitest run ../examples/instagram/client/providers/spock.test.ts
  • corepack pnpm@10.11.0 -C web run lint:provider
  • corepack pnpm@10.11.0 -C web run build:provider
  • repeated from a clean clone of this commit

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cad1711-fe47-484f-b393-6deb48378e52

📥 Commits

Reviewing files that changed from the base of the PR and between d0b3711 and 76a3900.

📒 Files selected for processing (2)
  • examples/instagram/client/providers/spock.test.ts
  • examples/instagram/client/providers/spock.ts

Walkthrough

The Spock provider adds an optional browser-local mode with static export discovery, deterministic snapshot data, in-memory RPC mutations, local object URLs, actor mapping, and cleanup. Tests cover authority startup, system information, like mutations, state observations, and asset resolution.

Changes

Browser-local Spock authority

Layer / File(s) Summary
Browser-local configuration and boot
examples/instagram/client/providers/spock.ts
Adds mode validation, static export compatibility checks, deterministic snapshot loading, local viewer verification behavior, and browser-local actor mapping.
In-memory mutations and local assets
examples/instagram/client/providers/spock.ts
Implements local RPC mutations, browser-local uploads and asset resolution, and object URL cleanup during disposal.
Browser-local authority test coverage
examples/instagram/client/providers/spock.test.ts
Updates the harness for provider configuration and tests startup, actor details, SetLike, observed state, and local asset resolution.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant BrowserSession
  participant InstagramAuthority
  participant SpockProvider
  participant LocalSnapshot
  participant LocalAssets

  BrowserSession->>InstagramAuthority: start browser-local session
  InstagramAuthority->>SpockProvider: initialize
  SpockProvider->>LocalSnapshot: load deterministic snapshot
  LocalSnapshot-->>InstagramAuthority: Ready authority state
  BrowserSession->>InstagramAuthority: SetLike mutation
  InstagramAuthority->>SpockProvider: dispatch local RPC
  SpockProvider->>LocalSnapshot: update viewer_liked
  LocalSnapshot-->>InstagramAuthority: updated observation
  BrowserSession->>InstagramAuthority: resolveAsset
  InstagramAuthority->>SpockProvider: resolve local asset
  SpockProvider->>LocalAssets: retrieve object URL
  LocalAssets-->>BrowserSession: local asset URL
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/browser-local-instagram-provider

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@softmarshmallow
softmarshmallow marked this pull request as ready for review July 23, 2026 11:24
@softmarshmallow
softmarshmallow merged commit f2f33d8 into main Jul 23, 2026
1 of 2 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.

1 participant