Skip to content

fix: retrieve cached catalog via Standalone Fetch when content_exists#267

Open
d-matsui wants to merge 8 commits into
masterfrom
fix/call-catalog-fetch
Open

fix: retrieve cached catalog via Standalone Fetch when content_exists#267
d-matsui wants to merge 8 commits into
masterfrom
fix/call-catalog-fetch

Conversation

@d-matsui
Copy link
Copy Markdown
Collaborator

Summary

⚠️ This PR depends on #266 (feat: implement Standalone Fetch).
Once #266 is merged, the diff will reduce to the 2 fix commits below.

  • fix(relay): include content_exists=true and Largest Location from cache in SUBSCRIBE_OK
  • fix(call): use Standalone Fetch to retrieve catalog immediately when content_exists=true

Changes

relay

  • Add TrackCache::largest_location() that resolves group_id/object_id by walking the delta chain
  • Attach largest location to SUBSCRIBE_OK when cache is non-empty
  • Add unit tests for largest_location()

call app (WASM bindings + TypeScript)

  • When SUBSCRIBE_OK indicates content_exists=true with a valid largest location,
    fetch the cached catalog immediately via Standalone Fetch instead of waiting for stream delivery
  • Always set setOnSubgroupObjectHandler after the fetch so subsequent catalog updates
    arriving via stream are still handled

Test plan

Tested manually in the call app example:

  • A late joiner in a call session sees the catalog immediately upon joining
  • Catalog updates republished by the publisher are still received via stream

d-matsui and others added 8 commits May 28, 2026 10:57
Add encode/decode for FETCH, FETCH_OK, FETCH_HEADER, and fetch object
fields. Consolidate into fetch.rs matching the structure of subgroup.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add is_empty guard in fetch_decoder to prevent spurious error logs
- Split catch-all arm into None/Some(Err) in fetch_data_receiver
- Add Fetch::End variant for clean stream termination
- Add resolve_object_id tests for subgroup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add end-to-end example for Standalone Fetch.
Alice publishes 3 groups, bob subscribes live then issues
fetch A/B/C to retrieve cached objects from the relay.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 28.54864% with 448 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.31%. Comparing base (d10deef) to head (fcb0624).

❌ Your patch check has failed because the patch coverage (28.54%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (12.31%) is below the target coverage (50.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #267      +/-   ##
==========================================
+ Coverage   10.61%   12.31%   +1.70%     
==========================================
  Files         160      173      +13     
  Lines        8496     9085     +589     
==========================================
+ Hits          902     1119     +217     
- Misses       7594     7966     +372     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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