microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

How to load history from azure blob storage using lazy load patterns. #6520

Closed nimeshnanda closed 2 years ago

nimeshnanda commented 2 years ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

SDK Version 4.15

Describe the bug

I am fetching user histories from azure blob storage based on conversation Ids and filtering activity type ="Message" and displaying data in initial state. I mean loading history at beginning using below code.

createStore({ activities: history }, getStoreConvertSpeakActivityToText(), getStoreDisableAdaptiveCardActionAfterClick(), getStoreBlockBrandMenuSuggestedActionActivity(),); }

history variable will have N number of history. Now, I want to load data by using lazy loading concept where initially it will load 10 records and keep loading other data without blocking user typing or any other activities.

I have implemented api with pagination option but I dont know how to load data while scrolling up and down at the startup. please make a note I am loading chat resumption here as well. chat resumption will have only 24 hours user and bot conversation but history will have before 24 hours data which will load first than chat resumption and at last user will type something in textbox and get response from bot.

Please suggestion some development approach.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Give a clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Tracking Status

Dotnet SDK [TODO]()

Javascript SDK [TODO]()

Python SDK [TODO]()

Java SDK [TODO]()

Samples [TODO]()

Docs [TODO]()

Tools [TODO]()

anishprasad01 commented 2 years ago

Hi @nimeshnanda,

Please take a look at the Azure Blobs documentation, it may provide some guidance on getting the data using various patterns. You might also find the Bot Framework documentation useful.

Additionally, the Microsoft Bot Framework team prefers that how-to questions be submitted on Stack Overflow.

The official Bot Framework Github repo is the preferred platform for information on submitting bug fixes and feature requests.

This issue will be closed, but if you have a bug or feature request, please feel free to open a new issue in the appropriate repository.

nimeshnanda commented 2 years ago

@anishprasad01

I don't understand why issue is closed without giving proper details.

I already mentioned that I am able to load the chat history from azure blob storage and able to display in botframework react-webchat component.

MY ISSUE - I am loading last 7 days user history and it takes time to load at initial stage. my concerns how can I load 20 - 20 histories in react-webchat.

I mean initially I will fetch 20 histories and display in webchat component than how I will make again api call and display history until everything get loaded in "activities" state. botframework react-webchat "activities" state getting updated with another 20 histories but not able to display in react. looks like createStore function having some issue.

createStore({ activities: history }, getStoreConvertSpeakActivityToText(), getStoreDisableAdaptiveCardActionAfterClick(), getStoreBlockBrandMenuSuggestedActionActivity())

history : variable have 20 histories before connecting to directline token api. my concerns is how to append history in "activities" react state.

anishprasad01 commented 2 years ago

We prefer that issues opened on our repositories deal with specific and reproducible bugs or feature requests.

We recommend that questions about development approaches be asked in a properly tagged StackOverflow question, where you will most likely get a wider audience and a higher likelihood of reaching someone who may have dealt with the same challenge.

If you have a defined and reproducible bug or feature request in Web Chat, you can open an issue on the Web Chat repository.