Skip to content

feat: send email for export raw#1881

Merged
pyphilia merged 7 commits into
mainfrom
export-mail-zip
Jun 2, 2025
Merged

feat: send email for export raw#1881
pyphilia merged 7 commits into
mainfrom
export-mail-zip

Conversation

@pyphilia
Copy link
Copy Markdown
Contributor

@pyphilia pyphilia commented May 23, 2025

For exporting, the zip creation is handled in the background and a download mail is sent. Meanwhile the request responds with 202 accepted.

The export request is logged in a corresponding table. Currently it does not do anything.

Expiration date is 7 days. Nothing cleans up after 7 days.

!! guests cannot use export. So we should use /download for downloading.

Following this PR we will:

  • add a queue, for the zip generation to be handled on a worker
  • this queue will also receive a schedule job to delete all archives and logs corresponding to old requests.

I didn't reuse action_request_export as we might want different schemas for actions export (json, csv) and item themselves (raw, graasp). We might want different expiration time, also we might want export not related to items (eg. export member data).

TODO

  • write tests

@pyphilia pyphilia requested a review from spaenleh May 23, 2025 11:54
@pyphilia pyphilia self-assigned this May 23, 2025
Copy link
Copy Markdown
Member

@spaenleh spaenleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR.

I have left comments related to general naming, we can decide to change them or not. I see quite a lot of the names would need to be changed.

Some of the comments are a bit nitpicking. Let me know.

Comment thread src/drizzle/schema.ts Outdated
Comment thread src/drizzle/schema.ts Outdated
Comment thread src/drizzle/0006_export-item-request.sql Outdated
Comment thread src/services/item/plugins/importExport/schema.ts
Comment thread src/services/item/plugins/importExport/schema.ts Outdated
Comment thread src/services/item/plugins/importExport/index.ts Outdated
Comment thread src/services/item/plugins/importExport/index.ts Outdated
Comment thread src/services/item/plugins/importExport/index.ts Outdated
Comment thread src/services/item/plugins/importExport/index.ts Outdated
Comment thread src/langs/en.json Outdated
@pyphilia pyphilia marked this pull request as ready for review May 28, 2025 13:58
@pyphilia pyphilia requested a review from spaenleh May 28, 2025 13:58
@pyphilia
Copy link
Copy Markdown
Contributor Author

Here are the links within the emails, should add ellipsis on the link maybe?

Screenshot 2025-05-28 at 13 27 06

Screenshot 2025-05-28 at 12 12 27

@spaenleh
Copy link
Copy Markdown
Member

@pyphilia I think adding an ellipsis defies the purpose of putting the link in plain text. users should be able to copy the link if needed even if it is not recognized by the email client. What does the plain text variant look like ?

@pyphilia
Copy link
Copy Markdown
Contributor Author

pyphilia commented May 28, 2025

Well people can hover the link, or right click and copy. If we wanted to lure users, we could change the text and have a different url in the href.

Screenshot 2025-05-28 at 16 35 57 Screenshot 2025-05-28 at 16 35 45

Copy link
Copy Markdown
Member

@spaenleh spaenleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work !

Comment thread src/drizzle/schema.ts
Comment thread src/services/item/plugins/importExport/test/index.test.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2025

@pyphilia pyphilia added this pull request to the merge queue Jun 2, 2025
Merged via the queue into main with commit 5a1d3e4 Jun 2, 2025
11 of 13 checks passed
@pyphilia pyphilia deleted the export-mail-zip branch June 2, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants