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

Fix History Back, Push Bugs #1447

Merged
merged 7 commits into from
Feb 12, 2021
Merged

Fix History Back, Push Bugs #1447

merged 7 commits into from
Feb 12, 2021

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented Feb 10, 2021

Fixes #1331

There were 3 implementations of a History class in the app:

  1. LogDetailsHistory.ts
  2. InputHistory.ts
  3. brim/entries.ts

This PR creates a single app/core/models/history.ts which is used in all the places the above 3 classes were used.

The bug was ins the "push" method of both LogDetailHistory.ts and InputHistory.ts. It did not properly "splice" the new record at the correct position, then delete all following entries. It simply "pushed" a new entry onto the array. The brim/entries.ts implementation did have it correct.

In the first commit I create a failing test that reproduces the bug.

To Do:

  • Fix the Input History. I actually needs to behave a little more simply than the others.

Copy link
Contributor

@mason-fish mason-fish left a comment

Choose a reason for hiding this comment

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

This is great, thanks for refactoring everything so neatly, love all that red. Just left a "tiny little" comment.

@@ -25,10 +25,11 @@ const StyledInput = styled.input`
outline: none;
}
`
// create a tiny little history closure
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment referring to this component or just a leftover note to self?

Copy link
Member Author

Choose a reason for hiding this comment

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

A left over note to self!

@jameskerr jameskerr merged commit 226ef3b into master Feb 12, 2021
@jameskerr jameskerr deleted the 1331-history-bug branch February 12, 2021 04:33
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.

"Back" button is not returning to previously-viewed record
2 participants