-
Notifications
You must be signed in to change notification settings - Fork 9
prevent circular proxy loop by collapsing immediate‑parent deref links #1656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ellyxir
merged 5 commits into
main
from
ellyse/ct-773-patterns-fix-hacky-linkedlist-copy
Aug 19, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
479e7c1
prevent circular proxy loop by collapsing immediate‑parent deref links
89c9a86
updated linkedlist pattern to no longer copy the list before calling …
590a0bf
removed comments
1d76ac5
chore(runner): compute childPath lazily in debug lambda (normalizeAnd…
8b8bb64
Merge branch 'main' into ellyse/ct-773-patterns-fix-hacky-linkedlist-…
ellyxir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does your data looks something like this?
I think doc would look like:
{"value": 1, "next": {"/": {"@link1": {"id": "baed", "path": []}}}normalizeAndDiffhas the seen map, so I'm curious why it's not sufficient here.Making the snapshot seems ok, since you're only using it to generate the diff (so you don't have to worry about being wrong if it gets out of sync), but I didn't get why it was required.
Is this a case where we're replacing an object with a link, and that replacement occurs on an
$alias?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we turn the "next" value into a link and it looks a bit like this:
[DEBUG][normalizeAndDiff::14:30:46.220] [BRANCH_CELL_LINK] Processing cell link at path=internal.#1.next link={"/":{"link@1":{"path":["internal","#1"],"id":"of:baedreidafjd3rgnpyyxxbwvvf75qc7vk2s5nzsbhw76djm4u2yhwkvptby","space":"did:key:z6MktpWYAnNacQL9AEkhqxaKR1qux7uU5rM6PjBvPst6LEWc"}}}
the problem is that it points to internal.__#1 which causes infinite loop when we traverse later. (and there is no js object for
seento keep track of here)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add the link to seen, but I think you've also added the object at ["internal", "#1"] to seen as well.
I think this is just that we don't handle circular links correctly everywhere (for example, one of my traverse functions is traverseDAG, since it does not handle them).
I think we're supposed to be supporting cycles, but I have no issue with disabling them here if that's the simplest approach.