Skip to content

Keep an app's removal removed in the page; quiet benign rights-walk warnings - #1705

Closed
michielbdejong wants to merge 2 commits into
claude/app-read-your-writesfrom
claude/app-write-remove
Closed

michielbdejong wants to merge 2 commits into
claude/app-read-your-writesfrom
claude/app-write-remove

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Stacked on #1690.

Closes #1703
Closes #1704

A value removed through /app-write came back (#1703)

The server was already applying the removal correctly. The new handler test an_app_removes_a_property_and_it_stays_removed checks that. It uses the timesheets shape: a localId and an import baseline, then remove followed by save.

The value came back in the host page's copy. The post-write refresh goes over the WebSocket, and a SNAPSHOT-flagged GET runs importLoroUpdate(bytes, replace = true). That reset the Loro doc but kept #cache, which still held the values from before the write. getLoroDoc()'s heal pass then wrote every key the snapshot lacked back into the doc as a local op. The fix: the replace path clears the non-server-derived cache before rebuilding.

  • vitest a replacing snapshot drops properties the source removed (browser/lib/src/resource.test.ts) failed before the fix and passes after.
  • e2e a value an app removes is gone, for the app and on the server (apps.spec.ts): a real frame runs remove().save() and then getResource. It showed Goes away before the fix. The whole apps.spec.ts passes (7/7).

"rights walk TERMINATED: get_parent failed" (#1704)

Harmless. Every one of the 1488 warnings from one apps.spec.ts run came from a walk that reached a root (no parent). That happens in the drive-first probe for an app's own agent, and when a query filters out members an agent can't read. The walk now logs that case at debug. Warn is kept for a parent that is named but can't be loaded, which is the real 401 case. After the change the same run logs 0 warnings. Rights evaluation is unchanged.

No UI change.

🤖 Generated with Claude Code

An app's `resource.remove(p).save()` reached the server and stuck there,
but the host page's copy got `p` back. The post-write refresh goes over
the WebSocket, where a SNAPSHOT-flagged GET makes
`Resource.importLoroUpdate(bytes, replace = true)` reset the Loro doc but
keep `#cache`, which still held the old values. `getLoroDoc()`'s heal pass
then wrote every key the snapshot lacked back into the doc as a local op.
The replace path now clears the cache first, except for server-derived
keys.

Tests: a vitest for the replace path, an apps e2e that removes a value
from inside a real frame, and an app-write handler test showing the
server side was already right.

Also log "rights walk TERMINATED" at debug when the walk simply reaches a
root with no grant (the drive-first probe for an app's agent, query
member filtering). Keep warn only when a parent is named but cannot be
loaded, which is where a real 401 comes from. Rights evaluation is
unchanged.

Closes #1703
Closes #1704

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-commit lint was skipped when this branch was committed with
--no-verify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong

Copy link
Copy Markdown
Contributor Author

Merge-risk triage (2026-09-28). This is a read-only review of this PR's own diff. The rule it applies: nothing that works today may break for existing users or clients, and new behaviour is added alongside the old. The stack is being rebased onto develop as one chain before merging, so line references are against the current stacked base.

Verdict: SAFE after the planned trim

develop already superseded its resource.ts fix (#1853/#1857). The rebase cuts it down to its tests plus the rights-walk log-level change.

🤖 Generated with Claude Code

@michielbdejong

Copy link
Copy Markdown
Contributor Author

Closing as part of the plugin-host stack cleanup (Q-101): not needed by atomic-plugins now. See the inventory at #1726 (comment). The branch is kept, and pin candidates are unaffected. Closed by Claude (VPS coordinator) on behalf of Michiel.

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