-
Notifications
You must be signed in to change notification settings - Fork 199
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
Getting JSON.parse error in teamsFx internal file when the conversation is initiated from the MS Teams #12887
Comments
Hello @bhaskar-012024 , Thank you for your inquiry about your Teams app development issue! To assist you better, could you please provide the following details? Reproduction Steps: Please share the steps you took to encounter the issue. Documentation Links: Any specific documentation you followed that relates to your problem. Teams Client Version: What version of the Teams client are you using? Code Snippets: Relevant code snippets that illustrate the issue. This information will help us better understand the situation and provide a more accurate response. |
Hi @bhaskar-012024, what kind of API have you used from @microsoft/teamsfx? E.g. notification? |
Hi @tecton , const { BotBuilderCloudAdapter } = require('@microsoft/teamsfx'); const notificationApp = new ConversationBot({ const member1 = await notificationApp.notification.findMember( |
Hi @bhaskar-012024, it might be caused by the corrupted cache file. Could you please delete/check the ".notification.localstore.json" file and try again? |
Yes @tecton , thank you for providing the resolution. Now it is working as expected. |
Hi @bhaskar-012024, this file is used as a default implementation to persist bot notification target references in the file. It's recommended to use your own store for production environment by extending interface |
Hi @tecton , I have gone through this documentation for ConversationReferenceStore and its methods like add, list and remove. I understand like this is used to store the conversation reference of the user interacted with the bot and use it later to only send proactive message. Code structure where i am using notificationApp const { BotBuilderCloudAdapter } = require('@microsoft/teamsfx'); const notificationApp = new ConversationBot({ Case1 : To retrieve email Case 2: To identify user by email and send notification Then using member.parent.conversationReference proprty to get the conversation reference , user id, service url and sending proactive message using Do i need to still use ConversationReferenceStore and store the details even if I was not using then to send the proactive message? |
Hi @bhaskar-012024, yes you need to use conversation reference store to find member. You can choose what properties to store when implement the interface. |
Key Components Used:
Recently we started getting errors when the user interacts with the Bot via Teams app. Interesting thing is we haven't made any changes to the Azure Bot or WebApp or any component in the structure recently but suddenly we stated seeing below error that is refereeing to a JSON.parse statement in the @microsoft/teamsfx/dist/index.node.cjs.js internal file, which obviously we haven't directly called in any of our code. Previously it is working perfectly fine, and we don't have any issue but not sure why we are receiving this error now without any change in configuration or code.
When we test the same bot directly from the Azure portal inside Azure Bot> Settings> Test in Web Chat it is working perfectly fine but we are getting issue only when there is any conversation from the MS Teams channel.
I am using the TeamsFx version of 2.3.1 and i tried to update it to 2.3.2 and 2.3.3 but still facing the issue. My Azure app node version was 20 and i tried with 18 also but no luck.
Please let me know if any further information is required. Any help in resolving issue is much appreciated.
The text was updated successfully, but these errors were encountered: