Skip to content

Conversation

@rarajes2
Copy link
Contributor

@rarajes2 rarajes2 commented Nov 19, 2025

COMPLETES #< Ad-hoc >

This pull request addresses

Fixes the timer issue for the handleCallEstablished function.

This is continuation of the PR - #4557

by making the following changes

Clearing the interval in success case and rescheduling a new interval. Logic is bit altered to use setTimeout instead of setInterval now.

Change Type

  • 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 change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

Tested the following with the burp suite (to update the response header)

  • For 4xx cases the call was being cleaned up
  • For 5xx cases with retry-after, it honors the value if provided else fallback to 30 sec retry interval
  • Tries max of 4 retries after first failure and if all fails it stops the retries
  • Failed 3 keepalives and then let 1 pass which did reset the counter and again letting the keepalive fail for 4 times stops sending further keepalive request

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@rarajes2 rarajes2 requested a review from a team as a code owner November 19, 2025 06:17
@rarajes2 rarajes2 added the validated If the pull request is validated for automation. label Nov 19, 2025
@rarajes2 rarajes2 force-pushed the fix-handleCallKeepalive-timer branch from 39c5696 to 7c64dea Compare November 19, 2025 06:27
Copy link
Contributor

@adhmenon adhmenon left a comment

Choose a reason for hiding this comment

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

Have we tested with agent desktop?
I am a bit worried about that case as any change in timer logic might cause issues on their side since AD isn't exactly a browser app...

}

this.sessionTimer = setInterval(async () => {
this.sessionTimer = setTimeout(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's discuss this once you are back. We should not remove setInterval itself in my opinion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we can discuss this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated as discussed.

@rarajes2
Copy link
Contributor Author

Have we tested with agent desktop?

Tried testing on the AD but there seems to be some breaking change in the desktop login flow with the latest calling sdk. Please verify once and let me know if you are able to perform the desktop login with the latest calling SDK.

I am a bit worried about that case as any change in timer logic might cause issues on their side since AD isn't exactly a browser app...

Not sure what do you mean by AD isn't exactly a browser app...

@adhmenon

@rarajes2
Copy link
Contributor Author

@adhmenon - Testing on the AD is not required for this.

log.log('Resetting session timer', loggerContext);

clearInterval(this.sessionTimer);
clearTimeout(this.sessionTimer);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be clearInterval I believe, also we may not need this block at all now because we are never calling Established handled in recurring manner anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, this is not needed anymore. Removed.

await Promise.resolve();

expect(postStatusSpy).toHaveBeenCalledTimes(2);
expect(scheduleKeepaliveSpy).toHaveBeenCalled();
Copy link
Contributor

Choose a reason for hiding this comment

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

How many times this has been called, add that please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Kesari3008
Copy link
Contributor

Please add manual test results in the PR description. I would like to take a look

@rarajes2 rarajes2 enabled auto-merge (squash) November 20, 2025 13:49
@rarajes2 rarajes2 merged commit c2f8743 into webex:next Nov 20, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants