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

Create [PRE]APPEND_MEDIA action to add uploaded media instead of SET_MEDIA #2513

Closed
cvolzke4 opened this issue Jun 16, 2020 · 3 comments
Closed
Labels
Group: 3P Media Third-party media provider integrations. Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Type: Performance Performance related issues and enhancements.

Comments

@cvolzke4
Copy link
Contributor

cvolzke4 commented Jun 16, 2020

Task Description

Today, local media uses SET_MEDIA to set the entire media list when uploading media. This is bad practice, as uploading media becomes an n^m operation (n=images uploaded, m=list size), and may be prone to race conditions. A better approach would be have an action that adds the uploaded media to the list.

@cvolzke4 cvolzke4 added Type: Task Tasks which do not involve engineering Group: 3P Media Third-party media provider integrations. Pod: Media I/O labels Jun 16, 2020
@diegovar diegovar modified the milestone: Sprint 33 Jul 14, 2020
@bmattb bmattb added this to the Sprint 33 milestone Jul 14, 2020
@diegovar
Copy link
Contributor

According to the react developer tools, when a new page is loaded the existing media elements are not rerendered. Is this really necessary then?

@bmattb bmattb removed this from the Sprint 33 milestone Jul 27, 2020
@cvolzke4
Copy link
Contributor Author

According to the react developer tools, when a new page is loaded the existing media elements are not rerendered. Is this really necessary then?

This is actually for locally uploaded media. I've updated the description.

I think this is still worth doing for tech debt reduction. Consider when scrolled past 10,000 media resources, and then uploading 100 more by dragg/drop. This is now an n^2 operation, where 100 * 10,000 media resource entities have to be moved around, because each 100 individual uploads re-assigns the entire media list.

@cvolzke4 cvolzke4 changed the title Create APPEND_MEDIA action to append next page to 'media' list state Create APPEND_MEDIA (or prepend) action to add uploaded media instead of SET_MEDIA Jul 28, 2020
@cvolzke4 cvolzke4 changed the title Create APPEND_MEDIA (or prepend) action to add uploaded media instead of SET_MEDIA Create [PRE]APPEND_MEDIA action to add uploaded media instead of SET_MEDIA Jul 28, 2020
@dreamofabear dreamofabear added Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ P3 Nice to have and removed Type: Task Tasks which do not involve engineering labels Sep 24, 2020
@dreamofabear dreamofabear added Type: Performance Performance related issues and enhancements. P4 and removed P3 Nice to have Pod: Media I/O labels Oct 1, 2020
@swissspidy
Copy link
Collaborator

A prependMedia reducer now exists since #6541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: 3P Media Third-party media provider integrations. Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Type: Performance Performance related issues and enhancements.
Projects
None yet
Development

No branches or pull requests

5 participants