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

Basic prep #1792

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Basic prep #1792

wants to merge 8 commits into from

Conversation

CxRes
Copy link
Collaborator

@CxRes CxRes commented Aug 30, 2024

No description provided.

Implements Per Resource Events notifications in Node Solid Server.

Implementation Notes:
+ Uses `--experimental-require-module` to load esm packages natively. Requires node > 22.0.0. Start scripts and test invocations have been appropriately modified.
+ NSS converts strings into an older streaming format which was not being detected by Express-PREP. Express-PREP was modified to ask the user if the body provided is a stream, thus circumventing this issue.
+ Notifications are triggered from a common middleware, which is invoked after the response has been succesfully sent.
+ Uses Express PREP supplied default template for notifications.
Add Solid/Activity Streams format notifications:
+ Provides notifictions in JSON-LD and Turtle.
+ Extends notifications to PUT and POST methods.
+ Add Event-ID header field to the response of a write method.
@CxRes
Copy link
Collaborator Author

CxRes commented Aug 30, 2024

I do not understand why nyc is failing with EEXIST. Will need some help here as I am blind testing on Windows.

nyc does not work with ESM called with require().
@CxRes
Copy link
Collaborator Author

CxRes commented Aug 30, 2024

If I disable nyc (now replaced with c8), I get just one other error https://github.com/CxRes/node-solid-server/actions/runs/10639483327/job/29497511727#step:12:702

I am not sure if this error is an artifact of running tests in my own repo or actually a bug!

@CxRes CxRes requested a review from bourgeoa August 30, 2024 21:57
Parent path is correctly determined only for non root resources. Parent notifications are only generated when resources have a parent.
Node 20.17.0 LTS supports require(ESM). Therefore, allowing current Node LTS as well.
When checking response `Content-Type` during integration tests, relaxed all media-type values to regex.
@CxRes CxRes force-pushed the basic-prep branch 2 times, most recently from 5c7f336 to 6355d9e Compare September 9, 2024 01:01
Picks the repository from where the PR branch exists.
@CxRes
Copy link
Collaborator Author

CxRes commented Sep 9, 2024

Tests pass. Phew!

I would need guidance for writing tests specific to notifications.

Also need to check with reviewers if they are happy migrating to Node 20 (which is the active LTS).

@bourgeoa
Copy link
Member

bourgeoa commented Sep 9, 2024

Tests pass. Phew!

Well done.

I would need guidance for writing tests specific to notifications.

I don't know what to say.

  • unit express-prep test should not be included in NSS
  • reading from your code I would run
    • some tests on notification handler
    • integrated tests for the remaining
      • set notification
      • tests on the response

Also need to check with reviewers if they are happy migrating to Node 20 (which is the active LTS).

  • I don't see any issue with that, except that it may break some implementation that are unable to move to the new node minimal standard.
    This is less an issue if running on docker nowadays.
    I will have to check if solidcommunity.net can run on it.

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.

2 participants