Skip to content

[connected-solid] Get root container from storage description resource#136

Merged
jaxoncreed merged 4 commits intoo-development:mainfrom
mrkvon:fix-17-root-from-storage-description
Mar 25, 2026
Merged

[connected-solid] Get root container from storage description resource#136
jaxoncreed merged 4 commits intoo-development:mainfrom
mrkvon:fix-17-root-from-storage-description

Conversation

@mrkvon
Copy link
Copy Markdown
Contributor

@mrkvon mrkvon commented Mar 9, 2026

Based on Solid protocol: https://solidproject.org/TR/protocol#server-storage-description-resource

resource.getRootContainer() tries to discover root storage from storage description resource. If that fails, it falls back to discovery by parent container traversal.

Also submethods have been added:

  • resource.getRootContainerByTraversal() - the original method
  • resource.getRootContainerFromStorageDescription() - the new feature

I recommend hiding whitespaces when reviewing (especially tests), because multiple tests have been nested into additional describe, otherwise unchanged.
image

TODO:

  • add comments
  • cache results?
  • ...

Fixes #17

@mrkvon mrkvon changed the title Get root container from storage description resource [connected-solid] Get root container from storage description resource Mar 9, 2026
@mrkvon mrkvon force-pushed the fix-17-root-from-storage-description branch from acb5db8 to 306bc77 Compare March 12, 2026 01:50
@mrkvon mrkvon marked this pull request as ready for review March 12, 2026 12:09
@mrkvon mrkvon force-pushed the fix-17-root-from-storage-description branch from 406b800 to 4f93323 Compare March 12, 2026 12:30
Copy link
Copy Markdown
Contributor

@jaxoncreed jaxoncreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. I like the idea of splitting into the two getRootContainerByTraversal and getRootContainerFromStorageDescription.

Though, you commented a TODO referencing caching, and I gave a comment on how to implement it.

@mrkvon mrkvon force-pushed the fix-17-root-from-storage-description branch 4 times, most recently from dbd8c15 to 3271d97 Compare March 23, 2026 17:58
Copy link
Copy Markdown
Contributor

@jaxoncreed jaxoncreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mrkvon and others added 4 commits March 25, 2026 00:19
- cache storage description uri for each resource
- cache root container from storage description of each resource

Also add comments.
Co-authored-by: jaxoncreed <jaxoncreed@gmail.com>
Also:
- fix test
- add note to jsdoc about preferring generic getRootContainer
@mrkvon mrkvon force-pushed the fix-17-root-from-storage-description branch from 3271d97 to 7670891 Compare March 24, 2026 23:19
@jaxoncreed jaxoncreed merged commit 5838c88 into o-development:main Mar 25, 2026
2 checks passed
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.

Use the Storage link header to get the root resource rather than travering

2 participants