Skip to content

Fixed sample - graph change notification #1645

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

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

Jegadeesh-MSFT
Copy link
Contributor

No description provided.

Copy link
Contributor

@Copilot 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 Graph Change Notification sample to improve developer experience, bump toolkit schema versions, and migrate the Azure AD app manifest to the new schema.

  • Added “Try it yourself” sections with demo manifest links in both NodeJS and C# READMEs
  • Bumped Teams Toolkit YAML schema to v1.8 and adjusted local provisioning steps
  • Refactored AAD manifest to the v2 schema, introduced a static TokenStore, and enhanced the notification controller to fetch presence via Graph

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
samples/graph-change-notification/nodejs/README.md Added manifest link under “Try it yourself”
samples/graph-change-notification/csharp/README.md Added manifest link under “Try it yourself”
samples/graph-change-notification/csharp/M365Agent/m365agents.yml Bumped YAML schema and version to v1.8
samples/graph-change-notification/csharp/M365Agent/m365agents.local.yml Bumped YAML schema to v1.8; refactored writeToEnvironmentFile and provisioning echo steps
samples/graph-change-notification/csharp/M365Agent/aad.manifest.json Migrated AAD app manifest to new v2 schema
samples/graph-change-notification/csharp/ChangeNotification/Helper/ChangeNotification.cs Added TokenStore; unused import introduced
samples/graph-change-notification/csharp/ChangeNotification/Dialogs/MainDialog.cs Storing token in static TokenStore
samples/graph-change-notification/csharp/ChangeNotification/Controllers/NotificationController.cs Enhanced notification handler to log and fetch presence via GraphClient
README.md Added demo-manifest link for Change Notification sample
Comments suppressed due to low confidence (2)

samples/graph-change-notification/csharp/M365Agent/m365agents.local.yml:16

  • The comment is indented under writeToEnvironmentFile, but ensure the mapping structure aligns with the schema. Verify that writeToEnvironmentFile is correctly treated as a mapping rather than a scalar.
      # Write the information of created resources into environment file for the specified environment variable(s).

samples/graph-change-notification/csharp/M365Agent/m365agents.local.yml:38

  • Splitting the echo across two lines will break the shell command (the second line is just a string literal). Combine both commands onto one line or prefix the second line with echo.
        echo "::set-teamsfx-env MICROSOFT_APP_TYPE=MultiTenant"; echo

@@ -1,4 +1,5 @@
using AdaptiveCards;
using System.Collections.Concurrent;
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

This using directive is not used anywhere in this file. Consider removing it to keep imports clean.

Suggested change
using System.Collections.Concurrent;

Copilot uses AI. Check for mistakes.

@@ -27,4 +28,8 @@ public Microsoft.Bot.Schema.Attachment GetAvailabilityChangeCard(string Header,
};
}
}
public static class TokenStore
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

Storing and sharing the token in a static field can lead to race conditions and token leakage across conversations. Consider using BotState or dependency injection to store per-user tokens securely.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@Harikrishnan-MSFT Harikrishnan-MSFT left a comment

Choose a reason for hiding this comment

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

Approved— Please take care of the Copilot comments.

Copy link
Collaborator

@Pawank-MSFT Pawank-MSFT left a comment

Choose a reason for hiding this comment

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

looks correct, Approving!

@Harikrishnan-MSFT
Copy link
Contributor

@Harikrishnan-MSFT Harikrishnan-MSFT merged commit af3307d into main Jun 18, 2025
278 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