Skip to content
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

How to make bot references persistant #263

Open
Githamza opened this issue Feb 9, 2022 · 1 comment
Open

How to make bot references persistant #263

Githamza opened this issue Feb 9, 2022 · 1 comment

Comments

@Githamza
Copy link

Githamza commented Feb 9, 2022

Actually i'm working on an app ( bot + tab ) : in meeting app

My tab is asking for participant infos.

Actually when I made an edit on back-end then reload it all my references get lost

my question is how can I change meetingInfoRepository.js to persist data on Azure Blob Storage instead of local Object?

All code example is here

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

/**
 * This component is used to store meeting and conversation context.
 */
class MeetingInfoRepository {
    constructor(name, year) {
        this.conversationReferences = {};
        this.meetingContexts = {};
    }

    setConversationReference(conversationReference) {
        this.conversationReferences[conversationReference.conversation.id] = conversationReference;
    }

    getConversationReference(conversationId) {
        return this.conversationReferences[conversationId];
    }

    setMeetingContext(meetingId, context) {
        this.meetingContexts[meetingId] = context;
        console.log("Update meeting context: ", Object.keys(this.meetingContexts));
    }

    getMeetingContext(meetingId) {
        console.log("Trying to get context with ID: ", meetingId);
        return this.meetingContexts[meetingId];
    }
}

// Export singleton
module.exports = new MeetingInfoRepository();
@JerryYangKai
Copy link
Contributor

What you found is the MeetingInfoRepository 's problem. This is just a sample to show how to store the data temporarily. It is in the server's cache, so it will lose it when reload.
Using the Azure Blob Storage is a good way to solve this. What you need to do is import the Azure Blob Storage's lib and in the constructure init the blob client. Then you could save or get data in get() and set().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants