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

feat: Exporting all conversations in one go #2701

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakubmieszczak
Copy link
Contributor

Pull Request Template

--- WIP ---

Summary

--- WIP ---

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Testing

--- WIP ---

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@jakubmieszczak jakubmieszczak changed the title Rebase to current version Add exporting all conversations in one go feature May 14, 2024
@jakubmieszczak jakubmieszczak force-pushed the jakub.export-all-convos branch 3 times, most recently from c3cf09b to 2b36d78 Compare May 14, 2024 10:55
@jakubmieszczak jakubmieszczak changed the title Add exporting all conversations in one go feature feat: Exporting all conversations in one go May 14, 2024
logger.info('Downloading JSON file');
try {
//put this in a function
const { jobId } = req.params;
Copy link
Contributor

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?

Copy link
Contributor

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
Copy link
Contributor

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' });
Copy link
Contributor

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 () => {
Copy link
Contributor

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?

@DenisPalnitsky
Copy link
Contributor

It would be nice to add a unit tests for this functionality.

@danny-avila
Copy link
Owner

Great comments @DenisPalnitsky

Also thank you @jakubmieszczak for tackling this! 🙏

@jakubmieszczak jakubmieszczak force-pushed the jakub.export-all-convos branch 3 times, most recently from 891bbc6 to 10b58d1 Compare May 20, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants