Makes the first history position reloadable #116

Manually merged
sloum merged 2 commits from refresh-first-pg into develop 2019-12-09 04:21:44 +00:00
Owner

As stated in issue #109 , if a user is on the first history location (whatever their home page is set to most likely) reload was not working. This is because as part of reload it navigates backward and does a little trick to load the page again without losing forward history. However, moving backward into nothing is not possible.

To fix this I manually check to see that we are on the first history location, then manually move the location backward by one in order to make it possible to visit the url again and have it load to the same history slot. It sounds more complicated than it is.

As stated in issue #109 , if a user is on the first history location (whatever their home page is set to most likely) reload was not working. This is because as part of reload it navigates backward and does a little trick to load the page again without losing forward history. However, moving backward into nothing is not possible. To fix this I manually check to see that we are on the first history location, then manually move the location backward by one in order to make it possible to visit the url again and have it load to the same history slot. It sounds more complicated than it is.
sloum added this to the 2.1.0 milestone 2019-12-07 06:22:47 +00:00
sloum added the
bug
label 2019-12-07 06:22:47 +00:00
Collaborator

It does sound complicated!

I've checked this now and found that it is still possible to get the message "You are already at the beginning of history" when reloading a page.

  1. Load bombadillo
  2. Navigate to a new page - follow a link on the homepage, or load a new URL
  3. Go back to homepage
  4. Refresh homepage

It is working correctly otherwise. For example, the following succeeds:

  1. load bombadillo
  2. refresh homepage

I might get a chance to look deeper in to this later on.

It does sound complicated! I've checked this now and found that it is still possible to get the message "You are already at the beginning of history" when reloading a page. 1. Load bombadillo 2. Navigate to a new page - follow a link on the homepage, or load a new URL 3. Go back to homepage 4. Refresh homepage It is working correctly otherwise. For example, the following succeeds: 1. load bombadillo 2. refresh homepage I might get a chance to look deeper in to this later on.
Author
Owner

Good catch! I hadnt thought about that. I was using the history length (as defined by the pages struct) as the guide-point for when to do a special handling case. I really needed to do it based on position within history instead. I have updated the code. Initial testing seems to show it working right, but I would appreciate it if you dont mind rerunning yours again just to double check.

Good catch! I hadnt thought about that. I was using the history length (as defined by the pages struct) as the guide-point for when to do a special handling case. I really needed to do it based on position within history instead. I have updated the code. Initial testing seems to show it working right, but I would appreciate it if you dont mind rerunning yours again just to double check.
Collaborator

Tested again, was unable to reproduce the issue 👍

Tested again, was unable to reproduce the issue :thumbsup:
sloum closed this pull request 2019-12-09 04:21:43 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sloum/bombadillo#116
No description provided.