Skip to content

Conversation

@Koc
Copy link
Contributor

@Koc Koc commented May 12, 2025

Right now module not ready to import large tables. This PR improves import flow by moving it into asynchronous job.

🗒️ TODO:

  • make import work for uploaded (not selected) files as well
  • revert changes to old endpoints, introduce new one instead
  • properly parse activity notification
  • fix pipelines and old tests
  • add new tests?

🔍 Preview

Notification once import scheduled
image

Activity item with import stats
image

🎥 Demo
https://github.com/user-attachments/assets/6be864ef-fb26-40a3-9e4c-c98e1d55419d

@Koc Koc force-pushed the feature/asyncronous-import branch from 5cbf833 to 3c2422c Compare May 12, 2025 16:00
@blizzz
Copy link
Member

blizzz commented May 23, 2025

Please keep in mind, existing API shall remain stable, but may be flagged deprecated.

@juliusknorr juliusknorr added enhancement New feature or request 3. to review Waiting for reviews 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 23, 2025
@Koc Koc force-pushed the feature/asyncronous-import branch 5 times, most recently from 9b0c3bd to 1dbdfe8 Compare May 26, 2025 15:47
@Koc Koc marked this pull request as ready for review May 26, 2025 15:47
@Koc Koc requested review from blizzz and enjeck as code owners May 26, 2025 15:47
@Koc
Copy link
Contributor Author

Koc commented May 26, 2025

@blizzz What exactly do you mean? Do not change already existent endpoint (keep it synchronous) but introduce v2/v3 for async tasks (even if this endpoints will be not in use on FE side)?

@blizzz
Copy link
Member

blizzz commented May 26, 2025

@blizzz What exactly do you mean? Do not change already existent endpoint (keep it synchronous) but introduce v2/v3 for async tasks (even if this endpoints will be not in use on FE side)?

Yes, exactly. The old ones can get the @deprecated annotation and point to the new method.

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

replied to questions

@Koc Koc force-pushed the feature/asyncronous-import branch 8 times, most recently from 1c49d2c to 599fecd Compare June 9, 2025 14:52
@Koc
Copy link
Contributor Author

Koc commented Jun 9, 2025

@blizzz I've reverted all changes to old endpoints. So they are completely untouched. Now we have also scheduleImportIn(Table|View) + scheduleImportUploadIn(Table|View). FE uses new endpoints.

Also it is possible to import uploaded files (app data used under the hood)

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

It is shaping up nicely! It looks like a file was not committed. Did not test yet.

@Koc
Copy link
Contributor Author

Koc commented Jul 27, 2025

I will rebase current PR and fix conflicts once #1824 got merged. Because both of those 2 PRs changes import a lot. Let's go step by step

@Koc Koc mentioned this pull request Aug 15, 2025
@enjeck
Copy link
Contributor

enjeck commented Oct 30, 2025

I will rebase current PR and fix conflicts once #1824 got merged

Hi @Koc . That got merged. Have time to continue this? Otherwise, I can take over from here to complete it

@Koc Koc force-pushed the feature/asyncronous-import branch from 599fecd to cdd78c0 Compare October 31, 2025 14:00
@Koc
Copy link
Contributor Author

Koc commented Oct 31, 2025

@enjeck yeah, I was about to rebase this PR

My plan:

  • fix conflicts after rebase and make PR work at least for the basic scenarios ✔️
  • display activity ✔️
  • start work on tests 🚧

I will try to do as much as I can by myself and ask for your help in case of struggling

@Koc Koc force-pushed the feature/asyncronous-import branch 7 times, most recently from f47a2ca to e20bab6 Compare November 2, 2025 23:01
@Koc Koc requested a review from blizzz November 3, 2025 08:57
@Koc
Copy link
Contributor Author

Koc commented Nov 3, 2025

@enjeck more or less done

At least we have green pipeline with adjusted old tests. I'm thinking how to extend tests with a new functionality. Meanwhile you can do another round of code review

@enjeck
Copy link
Contributor

enjeck commented Nov 3, 2025

@enjeck more or less done

At least we have green pipeline with adjusted old tests. I'm thinking how to extend tests with a new functionality. Meanwhile you can do another round of code review

Thanks for working on this! I don't think we'll need any new tests here, since the current tests are already extensive?

@Koc
Copy link
Contributor Author

Koc commented Nov 3, 2025

@enjeck in general yes, I've already actualized existent cypress tests

@Koc
Copy link
Contributor Author

Koc commented Nov 16, 2025

@enjeck @blizzz ok, so if we don't need any other tests here - what's blocks us from merge?

@enjeck
Copy link
Contributor

enjeck commented Nov 16, 2025

@enjeck @blizzz ok, so if we don't need any other tests here - what's blocks us from merge?

Sorry, I had this on my to-review list. I was mostly thinking about if multiple simultaneous imports could overload the server and if we want to rate limit on job creation. We recently added rate limits to import previews e.g https://github.com/nextcloud/tables/blob/main/lib/Controller/ImportController.php#L60 since there was the possibilility to DoS the server without these limits. Wondering what @blizzz thinks

@blizzz
Copy link
Member

blizzz commented Nov 25, 2025

@enjeck @blizzz ok, so if we don't need any other tests here - what's blocks us from merge?

Sorry, I had this on my to-review list. I was mostly thinking about if multiple simultaneous imports could overload the server and if we want to rate limit on job creation. We recently added rate limits to import previews e.g https://github.com/nextcloud/tables/blob/main/lib/Controller/ImportController.php#L60 since there was the possibilility to DoS the server without these limits. Wondering what @blizzz thinks

The factor for the DoS is that you could fire multiple requests at the same time and Tables would be busy parsing everything. The rate limiting makes it less likely by allowing only so much at the same time.

Now with that asynchronous approach, there is the upload, but otherwise the file is not being touched. So the risk that processing the input files leads to the DoS is negligible, as it might run sequentially or with just a few runners.

It could congest the job queue though, therefore it would make sense to apply the rate limit values here just as well.

@Koc Koc force-pushed the feature/asyncronous-import branch from e20bab6 to b81caed Compare November 26, 2025 19:57
@Koc
Copy link
Contributor Author

Koc commented Nov 26, 2025

It could congest the job queue though, therefore it would make sense to apply the rate limit values here just as well.

but how? can we add this in upcoming iterations?

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

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants