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

Improve SessionEventListener types #3766

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ within this mono-repo.

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

The following changes have been implemented but not released yet:

## Deprecation notice

- A new signature was introduced for `getSessionFromStorage` in release 2.3.0. The legacy signature is
Expand All @@ -30,6 +26,17 @@ const session = await getSessionFromStorage(sessionId, {
});
```

## Unreleased

The following changes have been implemented but not released yet:

### Bugfix

#### browser and node

- Fix the `Session` error listener typing by adding `Error` to the `errorDescription` type so that it reflects the actual behavior.
Thanks to @NoelDeMartin for fixing this issue.

## [2.3.0](https://github.com/inrupt/solid-client-authn-js/releases/tag/v2.3.0) - 2024-11-14

### Bugfix
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/SessionEventListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ type SESSION_RESTORED_ARGS = {
};
type ERROR_ARGS = {
eventName: typeof EVENTS.ERROR;
listener: (error: string | null, errorDescription?: string | null) => unknown;
listener: (
error: string | null,
errorDescription?: string | Error | null,
) => unknown;
};
type SESSION_EXTENDED_ARGS = {
eventName: typeof EVENTS.SESSION_EXTENDED;
Expand Down
Loading