Skip to content

SB-I367: Client service version changes for constructor issues#9420

Merged
pallakartheekreddy merged 9 commits intoSunbird-Ed:release-8.0.2from
JeraldJF:version-update
Nov 25, 2025
Merged

SB-I367: Client service version changes for constructor issues#9420
pallakartheekreddy merged 9 commits intoSunbird-Ed:release-8.0.2from
JeraldJF:version-update

Conversation

@JeraldJF
Copy link
Copy Markdown
Collaborator

SunbirdEd - Portal


Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.


Please choose applicable option

Example

  • Applicable
  • Not applicable

Type of change

Please choose appropriate options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Enhancement (additive changes to improve performance)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 24, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the @project-sunbird/client-services package from version 8.0.2 to 8.0.5 to address constructor-related issues (per ticket SB-I367). The update requires adding fetch API polyfills for Jest tests, as the new version likely uses libraries (such as @digitalbazaar/http-client with ky) that depend on browser fetch APIs not available in the Node.js test environment.

Key Changes:

  • Upgraded @project-sunbird/client-services from 8.0.2 to 8.0.5
  • Added fetch API polyfills in jest-global-mocks.ts to support test execution
  • Created custom Jest environment and jsonld mock to handle test dependencies

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/app/client/package.json Upgraded client-services to 8.0.5 and added abort-controller to devDependencies
src/app/client/jest-global-mocks.ts Added fetch API polyfills (Headers, Request, Response, FormData) and improved conditional checks for TextEncoder/TextDecoder
src/app/client/jest-environment-jsdom-with-fetch.js Created custom Jest environment extending jsdom to provide fetch polyfills on global, self, and window objects
src/app/client/__mocks__/jsonld.js Added Jest mock for jsonld library to avoid loading @digitalbazaar/http-client during tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,46 @@
const JSDOMEnvironment = require('jest-environment-jsdom').TestEnvironment;
const nodeFetch = require('node-fetch');
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

node-fetch is required but not listed in dependencies or devDependencies. This will cause a runtime error when the Jest environment tries to load. Add node-fetch to devDependencies in package.json:

"node-fetch": "^2.6.7"

Copilot uses AI. Check for mistakes.
// Required for @digitalbazaar/http-client which uses ky
if (typeof global.Headers === 'undefined') {
try {
const nodeFetch = require('node-fetch');
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

node-fetch is required but not listed in dependencies or devDependencies. This will cause a runtime error when trying to load the polyfills. Add node-fetch to devDependencies in package.json:

"node-fetch": "^2.6.7"

Copilot uses AI. Check for mistakes.
@pallakartheekreddy pallakartheekreddy merged commit 219dd0e into Sunbird-Ed:release-8.0.2 Nov 25, 2025
10 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.

3 participants