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

Implement browser history API based navigation, preventing page reloads between routings #1266

Merged
merged 27 commits into from
Oct 18, 2024

Conversation

mercihabam
Copy link
Member

@mercihabam mercihabam commented Oct 2, 2024

#1144

Checklist:

  • The sidebar item's active state updates when navigating
  • Ensure handlers for refresh links are applied so the browser doesn’t reload on click
  • Sorting and filtering work
  • Fix combined folder content not being loaded upon navigation
  • Can display flagged contents
  • Cronjob to reload active folder's content in the background
  • Refresh the list during navigation; at least in the background.
  • FIX: Navigating to a route, the data from a previous route gets fetched.
  • Fix unit tests relative to the js files output
  • When clicking on a message link while contents are still being fetched in the background, the requests should be aborted so the navigation is performed faster (Aborting the requests on the client doesn't help because, once the requests are sent, the server processes them synchronously, blocking other eventual requests. A solution could be processing the requests server-side asynchronously.)
  • Can requests be processed asynchronously? Let's keep track of this here: Message content requests are processed synchronously, resulting in a frozen screen when the user clicks on a message row. #1279

@mercihabam mercihabam force-pushed the prevent-page-reloads branch from 2e03409 to d6b9e10 Compare October 7, 2024 15:42
…hat data is consistantly displayed across routings
…ervers instead of only provided request server parameters
…e previously handled by hm_list_path() and hm_page_name() to the new navigation module. There are still a few occurences to move
…path(), hm_msg_uid(), and hm_page_name() to the new navigation module
@mercihabam mercihabam force-pushed the prevent-page-reloads branch from 778b33d to f08f8fa Compare October 11, 2024 08:31
@marclaporte marclaporte requested a review from kroky October 11, 2024 13:30
@marclaporte
Copy link
Member

@jacob-js A test is failing.

@mercihabam
Copy link
Member Author

@jacob-js A test is failing.

Locally the same test is succeeding, not sure why in the CI it is failing. @kroky could you have some insights?
Here is what I have when I execute that test:

LOGIN TESTS
 - loading site
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by tag name: body ...
 - finding element by class sys_messages
bad_login_values PASSED
 - loading site
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by tag name: body ...
 - finding element by class login_form
missing_password PASSED
 - loading site
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by tag name: body ...
 - finding element by class login_form
missing_username PASSED
 - loading site
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by tag name: body ...
 - finding element by class login_form
missing_username_and_password PASSED
 - loading site
 - finding element by name hm_page_key
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by tag name: body ...
 - finding element by class login_form
bad_login_key PASSED
 - loading site
 - logging in
 - finding element by name username
 - finding element by name password
 - finding element by selector input[value=Login]
 - waiting for page by class name: main_menu ...
 - finding element by class content_title
good_login PASSED
 - logging out
 - waiting for page by tag name: body ...
 - finding element by class sys_messages
good_logout PASSED

7 of 7 PASSED

Copy link
Member

@kroky kroky left a comment

Choose a reason for hiding this comment

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

Changes look good. I am also puzzled by the failing CI test - it is either an unsaved change that is triggering the password dialog on logout or somehow sys_messages become inaccessible for selenium. I think that needs to be debugged more in the pipeline itself, since it can't be reproduced locally. I'd try swapping logout with logout_no_save first.

@mercihabam mercihabam force-pushed the prevent-page-reloads branch from 2f17fe2 to 65a96ff Compare October 16, 2024 12:12
@mercihabam
Copy link
Member Author

Changes look good. I am also puzzled by the failing CI test - it is either an unsaved change that is triggering the password dialog on logout or somehow sys_messages become inaccessible for selenium. I think that needs to be debugged more in the pipeline itself, since it can't be reproduced locally. I'd try swapping logout with logout_no_save first.

The incoherence in the test results was due to different modes used in the test environment. The CI doesn't run in debug mode, whereas locally, the app is executed in debug mode.

@mercihabam mercihabam force-pushed the prevent-page-reloads branch from cd078f9 to 69af23b Compare October 16, 2024 15:30
@mercihabam mercihabam requested a review from kroky October 16, 2024 20:06
@mercihabam
Copy link
Member Author

@kroky could you look at the changes one more time please?

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