-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: Exporting all conversations in one go #2701
base: main
Are you sure you want to change the base?
feat: Exporting all conversations in one go #2701
Conversation
c3cf09b
to
2b36d78
Compare
logger.info('Downloading JSON file'); | ||
try { | ||
//put this in a function | ||
const { jobId } = req.params; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put that in a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that we wanted to handle user id and job id to make sure we return the appropriate http code
}; | ||
|
||
const downloadConversationsJsonFile = (data) => { | ||
// Assuming `data` is the downloadable content; adjust as necessary for your use case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI's comment?
|
||
const downloadConversationsJsonFile = (data) => { | ||
// Assuming `data` is the downloadable content; adjust as necessary for your use case | ||
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this seems not optimal. We kind of downloading potentially big file then storing it in memory. Can't we download it directly?
}; | ||
|
||
const pollJobStatus = (jobId, onSuccess, onError) => { | ||
const intervalId = setInterval(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be the same as pollJobStatus
?
It would be nice to add a unit tests for this functionality. |
Great comments @DenisPalnitsky Also thank you @jakubmieszczak for tackling this! 🙏 |
891bbc6
to
10b58d1
Compare
09c163c
to
3ed5f81
Compare
3ed5f81
to
be6ce47
Compare
Pull Request Template
--- WIP ---
Summary
--- WIP ---
Change Type
Please delete any irrelevant options.
Testing
--- WIP ---
Test Configuration:
Checklist
Please delete any irrelevant options.