Skip to content

test(e2e): add a device, share a Project and join a Team through the Viewer - #3081

Merged
kunickiaj merged 1 commit into
mainfrom
test/viewer-onboarding-flows
Nov 29, 2026
Merged

kunickiaj merged 1 commit into
mainfrom
test/viewer-onboarding-flows

Conversation

@kunickiaj

@kunickiaj kunickiaj commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Description

ADR 0007 requires an end-to-end test for each sync and sharing flow, completed without Advanced or the CLI. This adds a viewer-onboarding scenario that runs flows 1, 2 and 5 through the routes the Viewer's own screens call. Only the coordinator's first device is set up with the CLI (sync enable, coordinator group create, coordinator device enroll), which the ADR allows until the Viewer can set up a coordinator's first owner.

Each step and the Viewer screen it stands for:

  1. Share a Project with a teammate (flow 2). The owner shares alpha with Share exact Projects. The teammate accepts in Sharing → Accept an invitation and receives alpha.
  2. Add a second device (flow 1). The owner creates an add-device invitation for their own Identity, and the new laptop accepts it. In Devices, the owner confirms that the laptop belongs to their Identity. The laptop then receives alpha.
  3. Create a Team and join it on a new machine (flows 2 and 5). The owner uses Sharing → Teams → Create Team and gives the Team alpha with Projects → Update sharing. A second teammate accepts the Team invitation on a new machine and receives alpha.
  4. A device approved from an older connection-only code receives nothing. The device accepts the code in Sharing and is approved in Devices → Join requests. Sync is turned on in Settings. It discovers the other devices and syncs, but holds no memory. codemem 0.50 no longer creates these codes, so the coordinator's admin API mints one, as an older release did.

New memories in alpha reach all three devices. Neither the owner's beta memories nor anything else reaches any device.

Two things the scenario does deliberately:

  • The Team is given a Project that was already shared directly. A Project shared only with a Team never syncs today. The owner's reconciliation stops at recipient_policy_exact_mapping_required because nothing creates the Project's managed boundary.
  • The owner confirms the laptop in Devices. The first device was enrolled with the CLI, which records no Identity on the coordinator. So the owner's Viewer doesn't trust a new device for the owner's local Identity until the owner confirms it.

The E2E stack gains peer-d and peer-e, and the scenario joins the specialized matrix in ci.yml and e2e-full.yml.

Type of Change

  • 🚀 Feature (new functionality)
  • 🐛 Bug fix (fixes an issue)
  • 📚 Documentation (docs-only change)
  • 🔧 Maintenance (refactor, chore, CI, etc.)
  • 🧪 Testing (test-only changes)

Testing

  • CODEMEM_E2E_BUILD=1 pnpm run e2e:viewer-onboarding passed twice in an isolated Docker stack with synthetic data. Without the Devices confirmation, the second device receives nothing and the scenario fails.

  • pnpm run test:ci-workflow passed (75 tests), e2e/lib/compose.test.ts passed (21 tests), and the lint ratchet passed.

  • Relevant checks pass locally (pnpm run tsc, pnpm run lint, pnpm run test)

  • Added/updated tests for changes

  • Manually verified changes work as expected

Checklist

  • Code follows project style (pnpm run lint passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

…Viewer

A new viewer-onboarding scenario runs ADR 0007 flows 1, 2 and 5 through
the routes the Viewer's screens call. Only the coordinator's first device
is set up with the CLI, as the ADR allows. The owner shares a Project
with a teammate, adds a second device and confirms it in Devices,
creates a Team with that Project, and a second teammate joins the Team
on a new machine. A device approved from an older connection-only code
is enrolled and receives nothing. No device receives the Project the
owner kept.

The Team is given a Project that was already shared directly, because
a Project shared only with a Team never gets a Project boundary. The
scenario joins the specialized E2E matrix, and the stack gains peer-d
and peer-e.
@kunickiaj kunickiaj added the ci:full Force the full CI suite for this pull request label Nov 29, 2026

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T06:59:58.537035Z 3204d61 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.

@kunickiaj
kunickiaj merged commit d2c9967 into main Nov 29, 2026
31 checks passed
@kunickiaj
kunickiaj deleted the test/viewer-onboarding-flows branch November 29, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Force the full CI suite for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant