Skip to content

Run the file half in the browser stack and prove the photo flow end to end - #31

Merged
LucaCappelletti94 merged 2 commits into
mainfrom
feat/r69-browser-content
Sep 17, 2026
Merged

LucaCappelletti94 merged 2 commits into
mainfrom
feat/r69-browser-content

Conversation

@LucaCappelletti94

@LucaCappelletti94 LucaCappelletti94 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

This closes the leftover half of R69 step A. The browser stack now applies the file server deployment DDL and the wasm-smoke content.sql in the documented order, and spawns the real connetto-server with the content settings so the four file routes run in the shipped binary on its own listener at 127.0.0.1:18100, with a fresh Ed25519 DER ticket key, a temp file store swept every second, and CONNETTO_TEST_CONTENT_BASE handed to the suites.

Driving the flow for the first time exposed one real gap worth recording for D, E and F. The relay hub answers a tab row subscription from the worker replica and only records its tables for routing, only aggregates mint a private upstream subscription, so a table a tab must see live has to be in the worker's own upstream subscription set. DbWorkerConfig gains an additive with_extra_upstream builder, default empty and every existing boot byte-identical, and wasm-smoke gains a photo worker boot subscribing over photos next to orders.

The new examples/wasm-smoke/tests/photo_flow.rs is the first browser test a human could demo by hand. A tab stages a JPEG through the worker inside one transaction with the orders and photos rows, waits for the mirrored content_state to flip to available, a write only the server commit can make, resolves through the worker to a signed URL on the real listener and fetches the bytes back equal. The whole local browser stack run passed, 44 suites plus verified_topology, with stable and nightly clippy and fmt clean in the root, connetto-web and wasm-smoke workspaces. The plan status row for R69 now reads IN PROGRESS with D, E and F open.

Summary by Sourcery

Prove the browser photo flow end to end by wiring the file-serving half into the browser stack and allowing workers to subscribe to additional upstream tables.

New Features:

  • Run the browser-stack file flow against the shipped server binary, including deployment and content setup, a real content listener, temporary storage, and signed content tickets.
  • Add an end-to-end browser photo flow covering transactional staging, availability propagation, signed URL resolution, and byte-for-byte HTTP retrieval.

Bug Fixes:

  • Ensure worker replicas retain additional upstream subscriptions needed for tab-visible tables, while preserving existing default behavior.

Enhancements:

  • Extend database worker configuration to support additive extra upstream subscriptions and apply them consistently during boot and service startup.

Documentation:

  • Update the implementation plan to record R69 as in progress and document the completed browser-stack wiring and photo-flow proof.

Tests:

  • Add a wasm smoke test that exercises the complete photo content lifecycle through the browser relay and real file server.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @LucaCappelletti94, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 1 hour by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: LucaCappelletti94/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 724f2c6c-6283-4cbf-ab50-7f9d7ccd9f37


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-17T18:01:26.344168Z f3d53ac PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR completes the R69 browser-stack wiring by provisioning the file-server schema and content store, launching the real connetto-server content listener, extending worker upstream subscriptions for photos, and adding an end-to-end wasm smoke test that stages, commits, resolves, and fetches a JPEG through the shipped binary.

Sequence diagram for the browser photo content flow

sequenceDiagram
    actor Tab
    participant Worker as DBWorker
    participant Relay as RelayHub
    participant Server as ConnettoServer
    participant Store as FileStore

    Tab->>Worker: db_worker_photo_boot()
    Worker->>Relay: subscribe(db-upstream, DEMO_QUERY)
    Worker->>Relay: subscribe(db-photos-upstream, PHOTO_QUERY)
    Tab->>Worker: stage JPEG with orders and photos rows
    Worker->>Relay: commit transaction
    Relay-->>Worker: content_state available
    Tab->>Worker: resolve content
    Worker->>Server: resolve signed URL
    Server-->>Worker: signed URL
    Tab->>Server: fetch JPEG
    Server->>Store: read content
    Store-->>Server: JPEG bytes
    Server-->>Tab: JPEG bytes
Loading

File-Level Changes

Change Details Files
The browser-stack harness now provisions and runs the executable’s content-serving half end to end.
  • Apply file-server deployment DDL and wasm-smoke content SQL in dependency order.
  • Create temporary content storage and a fresh Ed25519 DER signing key with one-second sweeping.
  • Launch the real server with content configuration on 127.0.0.1:18100 and expose that base URL to tests.
  • Add startup port checks and cleanup guards for the content store and generated keys.
Cargo.lock
crates/connetto-test-harness/Cargo.toml
crates/connetto-test-harness/src/bin/connetto-browser-stack.rs
Database workers can maintain additional upstream subscriptions without changing existing configurations.
  • Add an additive with_extra_upstream builder with an empty default.
  • Use the combined subscription list during replica boot and boot-service setup.
  • Subscribe the wasm-smoke photo worker to the photos table alongside orders.
crates/connetto-web/src/workers/boot/mod.rs
crates/connetto-web/src/workers/boot/replica.rs
crates/connetto-web/src/workers/boot/services.rs
examples/wasm-smoke/src/lib.rs
A dedicated browser smoke test proves the complete photo content flow against the real stack.
  • Boot a dedicated photo worker and connect a tab through the browser relay.
  • Stage JPEG bytes and insert orders/photos rows atomically in one transaction.
  • Wait for server-side content_state availability, resolve a remote signed URL, and verify fetched bytes match the staged payload.
examples/wasm-smoke/Cargo.toml
examples/wasm-smoke/Cargo.lock
examples/wasm-smoke/tests/photo_flow.rs
The implementation plan records the browser-stack milestone and remaining R69 work.
  • Mark R69 in progress with browser-stack wiring complete and D, E, and F still open.
plans/master-implementation-plan.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.27%. Comparing base (6ac98e2) to head (e34638d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   83.27%   83.27%           
=======================================
  Files         114      114           
  Lines       25693    25693           
  Branches    25693    25693           
=======================================
  Hits        21396    21396           
  Misses       3073     3073           
  Partials     1224     1224           
Flag Coverage Δ
client 64.21% <ø> (ø)
rest 55.98% <ø> (-0.39%) ⬇️
server 48.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@LucaCappelletti94
LucaCappelletti94 merged commit 85ef289 into main Sep 17, 2026
57 of 58 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