Skip to content

feat(sync): fetch a snapshot by the record it belongs to - #143

Open
PiquelChips wants to merge 1 commit into
feat/permissions-tokensfrom
feat/permissions-fetch-by-record
Open

PiquelChips wants to merge 1 commit into
feat/permissions-tokensfrom
feat/permissions-fetch-by-record

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

A snapshot is fetched by its tree's id. Any tree can be named that way, including one deep within a snapshot, whose paths would then read as if they were at the root. Once reading depends on paths, a caller could reach a directory they may not read by naming its tree.

FetchSnapshot now names the record whose snapshot to walk, of: a revision or an acceptance. The server walks that record's snapshot from its root and refuses anything else, so every path it walks is the path the content has. Sync::need and Sync::repair take the record too, and so does everything in a working copy that fetches a snapshot it lacks: moves, diffs, landings, converging and clones.

A move onto a new revision, made of what the working copy holds and not written yet, needs nothing from the remote, so it no longer asks.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae3cd68f-31c9-4050-b7fa-cf4c61d66f2c
Commits

Reviewing files that changed from the base of the PR and between 93381ad and 1a7880d.

Files selected for processing: 15

  • apps/origin-src/benches/sync.rs
  • apps/origin-src/src/annotations/promotion.rs
  • apps/origin-src/src/service.rs
  • apps/origin-src/src/sync.rs
  • apps/origin-src/src/tree.rs
  • apps/origin-src/src/workspace/land.rs
  • apps/origin-src/src/workspace/mod.rs
  • apps/origin-src/src/workspace/registry.rs
  • apps/origin-src/src/workspace/remote.rs
  • apps/origin-src/tests/http.rs
  • apps/origin-src/tests/sync.rs
  • crates/origin-client/src/lib.rs
  • crates/origin-shared/src/api.rs
  • crates/origin-shared/src/object/revision.rs
  • docs/openapi.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/permissions-fetch-by-record branch 3 times, most recently from de628f6 to fdd1ee5 Compare November 22, 2026 18:54
A snapshot was fetched by its tree's id. Any tree can be named that
way, including one deep within a snapshot, whose paths would then read
as if they were at the root: once reading depends on paths, a caller
could reach a directory they may not read by naming its tree.

`FetchSnapshot` now names the record whose snapshot to walk, `of`: a
revision or an acceptance. The server walks that record's snapshot from
its root, and refuses anything else, so every path it walks is the path
the content has. `Sync::need` and `Sync::repair` take the record too,
and so does everything in a working copy that fetches a snapshot it
lacks: moves, diffs, landings, converging and clones.

A move onto a new revision, made of what the working copy holds and not
written yet, needs nothing from the remote: it no longer asks.
@PiquelChips
PiquelChips force-pushed the feat/permissions-fetch-by-record branch from fdd1ee5 to 1a7880d Compare November 22, 2026 19:20
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