Skip to content

Commit

Permalink
[C#] chore: Fix turn state bug (#1035)
Browse files Browse the repository at this point in the history
## Linked issues

closes: #848  (issue number)

## Details

- C# turn state implementation had a bug where it didn't allow for
custom `TempState`.
- Removed "bot" object from gpt-me bot manifest. This will prevent users
from being able to message the bot - the behavior of which is undefined.

## Attestation Checklist

- [x] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (we use
[TypeDoc](https://typedoc.org/) to document our code)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
  - Local testing
  - E2E testing in Teams
- New and existing unit tests pass locally with my changes
  • Loading branch information
singhk97 authored Dec 7, 2023
1 parent 6cd7ae2 commit 972b39a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@ env/.env.*.user
env/.env.local
env/.env.staging
.env*
/dotnet/samples/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ public async Task<bool> LoadStateAsync(IStorage? storage, ITurnContext turnConte
}

// Add the temp scope
this._scopes[TEMP_SCOPE] = new TurnStateEntry(new TempState());
Record tempStateValue = ScopeDefaults.ContainsKey(TEMP_SCOPE) ? ScopeDefaults[TEMP_SCOPE] : new TempState();
this._scopes[TEMP_SCOPE] = new TurnStateEntry(tempStateValue);

// Clear loading task
this._isLoaded = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@
"canUpdateConfiguration": true
}
],
"bots": [
{
"botId": "${{BOT_ID}}",
"scopes": ["personal", "team", "groupChat"],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false
}
],
"permissions": ["identity", "messageTeamMembers"],
"validDomains": [
"${{BOT_DOMAIN}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@
"canUpdateConfiguration": true
}
],
"bots": [
{
"botId": "${{BOT_ID}}",
"scopes": ["personal", "team", "groupChat"],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false
}
],
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["${{BOT_DOMAIN}}"]
}

0 comments on commit 972b39a

Please sign in to comment.