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

Abstract services should not inject server/client-specific code #3974

Open
ybnd opened this issue Feb 11, 2025 · 0 comments · May be fixed by #3981
Open

Abstract services should not inject server/client-specific code #3974

ybnd opened this issue Feb 11, 2025 · 0 comments · May be fixed by #3981
Assignees
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back

Comments

@ybnd
Copy link
Member

ybnd commented Feb 11, 2025

Describe the bug

A few of our services are split into a server and client version to deal with differences between NodeJS and the browser:

  • CookieService
  • AuthService
  • HardRedirectService
  • KlaroService
  • AuthRequestService
  • ReferrerService

Most of these services are abstract, and extended by Server* and Client* classes to define platform-specific behaviour.

Unexpected issues can occur when the abstract class itself imports or injects platform-specific code
For example, CookieService and AuthService leak Express imports into client code.

We've seen this break new services depending on CookieService & AuthService with cryptic errors like

An unhandled exception occurred: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.

To Reproduce

N/A, mainly relevant when writing new code.

Expected behavior

Server and client logic should be split more cleanly.

@ybnd ybnd added bug claimed: Atmire Atmire team is working on this issue & will contribute back needs triage New issue needs triage and/or scheduling labels Feb 11, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Feb 11, 2025
@tdonohue tdonohue removed the needs triage New issue needs triage and/or scheduling label Feb 11, 2025
@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Feb 11, 2025
@AAwouters AAwouters linked a pull request Feb 13, 2025 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back
Projects
Status: 🏗 In Progress
Development

Successfully merging a pull request may close this issue.

3 participants