Skip to content
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

createEmptyContainerAt() and createEmptyContainerInContainer() #364

Merged
merged 4 commits into from
Aug 18, 2020

Conversation

Vinnl
Copy link
Contributor

@Vinnl Vinnl commented Aug 18, 2020

New feature description

This adds the ability to initialise a new Container in the Pod, and returns a SolidDataset that can be modified to add additional properties to the Container.

It adds a specific workaround for NSS, which does not support creating Containers using PUT, as mandated by the spec: nodeSolidServer/node-solid-server#1465

It also adds a small workaround for ESS, which currently expects a Link header.

Do note that ESS does currently have a bug that causes it to return a 412 Precondition Failed after creating the Container (even though it does properly create the Container) when using createEmptyContainerAt.

Checklist

  • All acceptance criteria are met. Apparently I chose slightly different function names. The others were thought of relatively ad-hoc, so I don't think that's a big issue?
  • Relevant documentation, if any, has been written/updated.
  • The changelog has been updated, if applicable.
  • New functions/types have been exported in index.ts, if applicable.
  • Commits in this PR are minimal and have descriptive commit messages.

@Vinnl Vinnl added the enhancement New feature request label Aug 18, 2020
@Vinnl Vinnl requested review from pmcb55 and NSeydoux August 18, 2020 09:35
@Vinnl Vinnl self-assigned this Aug 18, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 18, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f81969d:

Sandbox Source
inrupt/solid-client-js: sandbox Configuration

@Vinnl Vinnl changed the title Feat/1238 empty container createEmptyContainerAt() and createEmptyContainerInContainer() Aug 18, 2020
src/resource/solidDataset.test.ts Outdated Show resolved Hide resolved
src/resource/solidDataset.test.ts Outdated Show resolved Hide resolved
Unfortunately it does not support the spec-supported method of
creating a Container:
nodeSolidServer/node-solid-server#1465

As a workaround, we create a dummy file within the Container we
want to create, which should lead to the server creating the
Container on the fly. The dummy file is then immediately deleted
again.

Although this method theoretically works for other servers as well,
it is a bit cumbersome and more error-prone due to the multiple
consecutive requests. Therefore I decided to use it specifically
when we detect NSS's message about not supporting the
spec-prescribed method of creating a Container, so that it can be
easily removed wholesale once NSS is no longer a problem, and the
implementation does not surprise other contributors.
@vercel vercel bot temporarily deployed to Preview August 18, 2020 11:32 Inactive
@Vinnl Vinnl merged commit 7fa85b5 into master Aug 18, 2020
@Vinnl Vinnl deleted the feat/1238-empty-container branch August 18, 2020 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants