3DStreet / 3dstreet-editor

3DStreet Editor Repo
https://3dstreet.app
Other
19 stars 3 forks source link

feat: infinity scroll via button in scenes modal #320

Closed rostyslavvnahornyi closed 9 months ago

kfarr commented 10 months ago

https://github.com/3DStreet/3dstreet-editor/issues/304

kfarr commented 10 months ago

Hi @rostyslavvnahornyi , thanks for this first attempt and it was a helpful learning experience to understand the complexities of pagination. This PR has some issues I wanted to share, and it may be advise-able to retry this task with a new strategy.

There are 2 goals that I am evaluating this on:

Against both goals this PR performs worse than prior: It delays the user by reloading data that has already been loaded, and it uses more bandwidth to retrieve scenes than before.

But the good news is I hopefully can help with a more clearly defined test case which I document below. I don't have an idea for a better strategy as pagination is complicated, so I wish you luck in finding a solution that works!

Here is the test case:

TEST1 - current epic-v2-save-load branch

TEST2 - this infinity scroll via button branch

specific usability issues:

kfarr commented 10 months ago

Hi @rostyslavvnahornyi I am not sure why, but this works OK when using dev .env config but it does not work for production .env config (even running the same local code). See here for a video showing the issue: https://github.com/3DStreet/3dstreet-editor/assets/470477/7c3e6a9e-c84d-4e80-8f96-363787f5d047

rostyslavvnahornyi commented 9 months ago

Hi, @kfarr !

The issue was with the production configuration, so I added a new webpack production config. To start the production environment, use the following commands:

npm run start:build
npm run start:prod

With this configuration, the problem with infinite pagination is resolved in the production environment.

kfarr commented 9 months ago

Here is an updated list of issues after this QA pass:

Later tickets

[video1] video of a few issues: https://github.com/3DStreet/3dstreet-editor/assets/470477/d654634a-d728-4455-abcb-0742c20b6fe5

rostyslavvnahornyi commented 9 months ago

Hi, @kfarr!

We're currently facing an issue with pagination on the production environment due to the outdated webpack configuration. The old webpack configuration doesn't read environment variables, which is the root cause of the pagination problem.

The pagination is now functioning with the new webpack configuration. You can see it here

Previously, I had separated JS files in the dist directory to optimize the bundle. However, I realized there could be deployment issues, so I commented out the corresponding webpack plugin. As a result, we now have only one JS file in the dist directory.

I fixed the bug with the spinner in the unauthorized "My Scenes" tab.

I also reverted the changes back to "aframe-inspector-opened."

Regarding the "minor fixes" commit, I will provide more accurate commit names in the future. But for understanding this commit was related to resolving merge conflicts.

In conclusion, @kfarr, could you please review the firebase security rules for prod configuration and compare them with the dev environment? I suspect the main issue lies in the webpack configuration. If there are any problems with pagination on the production environment, we might need to adjust the webpack configuration for production. It seems that we don't encounter issues with the development configuration, but there are specific issues with the old production webpack configuration.

If you have any questions, I'll be glad to answer them!

kfarr commented 9 months ago

@rostyslavvnahornyi good news and bad news:

This returns us to the 4 options I presented to Viktoria:

  1. relax and give Rosty another few days to figure it out, I will be traveling anyway so it will be hard to review something again until Thursday or Friday
  2. asking for help (and paying for hours) from another senior engineer at Zade
  3. get on a call to discuss challenges or even tradeoffs with potential solutions.
  4. don't let sunk cost fallacy force us to continue down this path, open to considering a new clean PR for issue 304. It is ok to admit that the initial attempt needs to be reconsidered.
rostyslavvnahornyi commented 9 months ago

Hi @kfarr,

Could you please check the last commit? A more qualified engineer and I found a problem with pagination and we decided to solve it by changing from client pagination to server pagination. If you encounter any further issues with pagination, the probable cause might be related to the production configuration.

I hope this helps! Let me know if you have any more questions.

kfarr commented 9 months ago

@rostyslavvnahornyi the new logic works as expected however there are many issues that were caused by changes unrelated to pagination that you were attempting in this PR. The changes may be valid but should not be in this PR.

Instead, please create a new PR with ONLY the changes related to this pagination ticket. Other deployment issues should be addressed through other tickets or PRs.

rostyslavvnahornyi commented 9 months ago

Hi @kfarr ,

Pagination is not working with the old configuration. The main issue in the production configuration is that it’s controlled and initiated by the “webpack dev server” package, which leads to errors.

I propose using a best practice approach, which involves separating the webpack configurations for development and production. This way, we can better manage the configurations.

You can see the problem demonstrated in this video.

kfarr commented 9 months ago

@rostyslavvnahornyi I'm sorry to be annoyingly insistent upon this, and I'm not disputing your statement about deployment change being required, but please regardless split this in 2 clean PRs:

rostyslavvnahornyi commented 9 months ago

Hello @kfarr !

So, you can this PRs here feature/scenes-modal-pagination feature/webpack-prod

kfarr commented 9 months ago

Thanks Rosty! Highly appreciated

On Thu, Nov 23, 2023 at 1:11 AM Rostyslav Nahornyi @.***> wrote:

Hello @kfarr https://github.com/kfarr !

So, you can this PRs here feature/scenes-modal-pagination https://github.com/3DStreet/3dstreet-editor/pull/347 feature/webpack-prod https://github.com/3DStreet/3dstreet-editor/pull/346

— Reply to this email directly, view it on GitHub https://github.com/3DStreet/3dstreet-editor/pull/320#issuecomment-1824035480, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADS3TMGQJNRTVGKIGTP7K3YF4HLFAVCNFSM6AAAAAA6PNUTDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRUGAZTKNBYGA . You are receiving this because you were mentioned.Message ID: @.***>

kfarr commented 9 months ago

confirmed this worked as expected split into 2 separate PRs, closing this combined one