microsoftgraph / microsoftgraph/microsoft-graph-comms-samples

[PolicyRecordingBot] calls not cleaned up

Open
#537 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
253
Forks
275
Avg merge
1d 5h
Merged PRs (30d)
1

Description

It seems it can happen we miss the event that a call has ended. When we then send the heartbeat keepalive message for such a call, the system will reply with 404 call not found. We should then cleanup resources in the application. The heartbeat handler in the sample does not do this.

        protected override Task HeartbeatAsync(ElapsedEventArgs args)
        {
            return this.Call.KeepAliveAsync();
        }

it is only logged and forgotten:

        private void HeartbeatDetected(object sender, ElapsedEventArgs args)
        {
            var task = $"{this.GetType().FullName}.{nameof(this.HeartbeatAsync)}(args)";
            var taskObj = this.HeartbeatAsync(args);
            if (taskObj == null) return;
            this.GraphLogger.Verbose($"Starting running task: " + task);
            _ = Task.Run(() => taskObj).ForgetAndLogExceptionAsync(this.GraphLogger, task);
        }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PolicyRecordingBot sample's HeartbeatAsync and HeartbeatDetected handlers, then trace how KeepAliveAsync failures are logged. Ensure a 404 call-not-found response leads to application resource cleanup rather than only being forgotten, and verify the heartbeat path still handles other failures as before.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.