Skip to content

player level resume data changes#127

Merged
rushi-tekdi merged 1 commit into
tekdi:AI-assessmentfrom
rushi-tekdi:AI-Assessment
Jun 12, 2026
Merged

player level resume data changes#127
rushi-tekdi merged 1 commit into
tekdi:AI-assessmentfrom
rushi-tekdi:AI-Assessment

Conversation

@rushi-tekdi

Copy link
Copy Markdown
Collaborator

No description provided.

@rushi-tekdi
rushi-tekdi merged commit 12d0b88 into tekdi:AI-assessment Jun 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the TrackingContentService to extract resumeData from a PROGRESS event within detailsObject instead of parsing the contentType string, and filters out PROGRESS events from being saved into the content details. The review feedback recommends improving code safety and readability by using strict equality and inequality operators, applying optional chaining to prevent runtime errors, and simplifying the redundant try-catch block when extracting resumeData.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

contentTrackingId = result.contentTrackingId;
}
if(detailsObject){
const progressItem = detailsObject.find(item => item.eid == "PROGRESS");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use strict equality (===) and optional chaining (item?.eid) to prevent potential runtime errors if any item in detailsObject is null or undefined.

Suggested change
const progressItem = detailsObject.find(item => item.eid == "PROGRESS");
const progressItem = detailsObject.find(item => item?.eid === 'PROGRESS');

Comment on lines +254 to +271
try{
if(progressItem?.edata?.resumeData){
createContentTrackingDto.resumeData=progressItem?.edata?.resumeData;
}
else{
createContentTrackingDto.resumeData="0";
}
}
else{
createContentTrackingDto.resumeData="0";
catch(e){
}
let temp_resumeData=createContentTrackingDto.resumeData ? createContentTrackingDto.resumeData : 0;
await this.dataSource.query(
`UPDATE content_tracking set "resumeData"=$2 WHERE "contentTrackingId"=$1`,
[
contentTrackingId,
temp_resumeData
],
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The try-catch block is redundant here because optional chaining (progressItem?.edata?.resumeData) already safely handles potentially null or undefined values without throwing errors. Additionally, the logic can be simplified and made more readable by using a fallback value directly.

          const resumeData = progressItem?.edata?.resumeData || '0';
          createContentTrackingDto.resumeData = resumeData.toString();
          await this.dataSource.query(
            "UPDATE content_tracking set \"resumeData\"=$2 WHERE \"contentTrackingId\"=$1",
            [
              contentTrackingId,
              resumeData
            ],
          );

let eid = detail?.eid;
let edata = detail?.edata;
if (eid && edata) {
if (eid && edata && eid!='PROGRESS') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use strict inequality (!==) and add proper spacing around operators to adhere to standard TypeScript best practices and improve readability.

Suggested change
if (eid && edata && eid!='PROGRESS') {
if (eid && edata && eid !== 'PROGRESS') {

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79984500-f2b3-4cc6-a240-0f87fb66d8a3

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant